SpeechError
public enum SpeechError : LocalizedError
A error type returned when encountering errors in the speech engine.
-
An error occurred when requesting speech assets from a server API.
Declaration
Swift
case apiError(instruction: SpokenInstruction, options: SpeechOptions, underlying: Error?)
Parameters
instruction
the instruction that failed.
options
the SpeechOptions that were used to make the API request.
underlying
the underlying
Error
returned by the API. -
The speech engine did not fail with the error itself, but did not provide actual data to vocalize.
Declaration
Swift
case noData(instruction: SpokenInstruction, options: SpeechOptions)
Parameters
instruction
the instruction that failed.
options
the SpeechOptions that were used to make the API request.
-
The speech engine was unable to perform an action on the system audio service.
Declaration
Swift
case unableToControlAudio(instruction: SpokenInstruction?, action: SpeechFailureAction, underlying: Error?)
Parameters
instruction
The instruction that failed.
action
a
SpeechFailureAction
that describes the action attemptedunderlying
the
Error
that was optrionally returned by the audio service. -
The speech engine was unable to initalize an audio player.
Declaration
Swift
case unableToInitializePlayer(playerType: AVAudioPlayer.Type, instruction: SpokenInstruction, synthesizer: Any?, underlying: Error)
Parameters
playerType
the type of
AVAudioPlayer
that failed to initalize.instruction
The instruction that failed.
synthesizer
The speech engine that attempted the initalization.
underlying
the
Error
that was returned by the system audio service. -
There was no
Locale
provided during processing instruction.Declaration
Swift
case undefinedSpeechLocale(instruction: SpokenInstruction)
Parameters
instruction
The instruction that failed.
-
The speech engine does not support provided locale
Declaration
Swift
case unsupportedLocale(locale: Locale)
Parameters
locale
Offending locale