Interface IAsyncClient
interface IAsyncClient
Extends com.amazon.apmf.IStandard
Interface representing the TTS client that interfaces with the system
TTS service.
This interface offers methods for fetching voice and profile managers,
and for initiating and aborting the speech synthesis process. It
enables asynchronous interaction with the system TTS service.
Note: Asynchronous code execution will be handled in different way once
it is available in OmniKit. At that time we provide final IClient interface.
Methods
getOrMakeVoiceManager()
Fetches the voice manager.IVoiceManager*getOrMakeVoiceManager()
Returns
IVoiceManager*
The voice manager object.
Throws
ClientDisconnectedError— if the client disconnected from service.
getOrMakeProfileManager()
Fetches the profile manager.IProfileManager*getOrMakeProfileManager()
Returns
IProfileManager*
The profile manager object.
Throws
ClientDisconnectedError— if the client disconnected from service.
speak()
Synthesize speech using the provided input parameters and speech configuration, and play back the result using the default audio system. Playback is provided as a convenience for the client. The client is responsible for coordinating the audio system resources and utilization required by media playback. Note: Playback will begin immediately after the synthesis results are received and sufficiently buffered. Multiple synthesis requests could be queued up by the system TTS Service. Event listeners should be used to identify when a specific synthesis or playback request starts and finishes.IUtteranceContext*speak(IUtterance*utterance,AudioPlaybackSettings?audioPlaybackSettings)
Parameters
utterance
IUtterance* — Required
The IUtterance object containing the text to
synthesize and speech attributes.
audioPlaybackSettings
AudioPlaybackSettings? — Optional
The AudioPlaybackSettings object defining the
features of the resulting audio. In case of null the default settings
will be used.
Returns
IUtteranceContext*
Context object describing the synthesis request.
Throws
ClientDisconnectedError— if the client disconnected from service.
synthesize()
Initiate the speech synthesis process in an asynchronous manner. Multiple synthesis requests could be queued up by the system TTS Service. Event listeners should be used to identify when a specific synthesis request starts and finishes.IUtteranceContext*synthesize(IUtterance*utterance)
Parameters
utterance
IUtterance* — Required
The IUtterance object containing the text to be
synthesized and speech attributes.
Returns
IUtteranceContext*
Context object describing the synthesis request.
Throws
ClientDisconnectedError— if the client disconnected from service.
cancelAll()
void cancelAll()
Aborts all syntheses requested by the current client.
Throws
ClientDisconnectedError— if the client disconnected from service.

