Interface IUtteranceContext
interface IUtteranceContext
Extends com.amazon.apmf.IStandard
IUtteranceContext is an interface for managing a speech synthesis request.
It provides methods to fetch the utterance used, to check if the
synthesis is completed, and to fetch error details if an error occurs.
Methods
getUtterance()
Retrieves the utterance used for the synthesis request.IUtterance*getUtterance()
Returns
IUtterance*
The IUtterance object associated with the request.
getAudioPlaybackSettings()
Fetches the optional audio playback settings associated with the related utterance.AudioPlaybackSettings?getAudioPlaybackSettings()
Returns
AudioPlaybackSettings?
The return value is optional and might be absent.
The audio playback settings used for utterance playback on the device,
or null if not provided.
isCompleted()
bool isCompleted()
Checks if the related request has been completed
(finished or cancelled).
Returns
bool
The result of the check.
Throws
ClientDisconnectedError— if the client disconnected from service.
getCompletedReason()
UtteranceCompletedReason getCompletedReason()
Fetches the reason for the completion of the related request.
Returns
UtteranceCompletedReason
The reason for completion or null if the equest has not
concluded yet.
Throws
ClientDisconnectedError— if the client disconnected from service.
getError()
Fetches any error which has occurred during the request.com.amazon.apmf.IError?getError()
Returns
com.amazon.apmf.IError?
The return value is optional and might be absent.
An error encountered during the request, or null
if no error has occurred.
Throws
ClientDisconnectedError— if the client disconnected from service.
join()
void join()
Halts the current thread execution until the related synthesis
request is completed.
Throws
UtterancetNotCompletedError— or one of its children in case of error.InvalidInputError— if the requested input was invalid.ProviderNotAvailableError— if the provider for the requested voice is currently not available.VoiceNotAvailableError— if the requested voice is currently not available.ClientDisconnectedError— if the client disconnected from service.
cancel()
void cancel()
Cancels the synthesis request if it’s in progress or has not started yet.
Throws
ClientDisconnectedError— if the client disconnected from service.

