SpeechSynthesizingDelegate
public protocol SpeechSynthesizingDelegate : AnyObject, UnimplementedLogging
The SpeechSynthesizingDelegate protocol defines methods that allow an object to respond to significant events related to spoken instructions.
-
speechSynthesizer(_:encounteredError:)Default implementationCalled when the speech synthesizer encountered an error during processing, but may still be able to speak the instruction.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func speechSynthesizer(_ speechSynthesizer: SpeechSynthesizing, encounteredError error: SpeechError)Parameters
speechSynthesizerThe voice controller that experienced the failure.
errorAn error explaining the failure and its cause.
-
speechSynthesizer(_:didSpeak:with:)Default implementationCalled when the speech synthesizer finished pronouncing the instruction or encountered an error, from which it cannot recover.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func speechSynthesizer(_ speechSynthesizer: SpeechSynthesizing, didSpeak instruction: SpokenInstruction, with error: SpeechError?)Parameters
speechSynthesizerThe speech synthesizer performing the action.
instructionThe spoken instruction pronounced or attempted to pronounce
errorAn error explaining the failure and its cause if any
-
speechSynthesizer(_:didInterrupt:with:)Default implementationCalled when one spoken instruction interrupts another instruction currently being spoken.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func speechSynthesizer(_ speechSynthesizer: SpeechSynthesizing, didInterrupt interruptedInstruction: SpokenInstruction, with interruptingInstruction: SpokenInstruction)Parameters
speechSynthesizerThe speech synthesizer that experienced the interruption.
interruptedInstructionThe spoken instruction currently in progress that has been interrupted.
interruptingInstructionThe spoken instruction that is interrupting the current instruction.
-
speechSynthesizer(_:willSpeak:)Default implementationCalled when a spoken instruction is about to be vocalized. Useful if it is necessary to give a custom instruction instead. Note that changing the
distanceAlongStepproperty onSpokenInstructionwill have no impact on when the instruction will be said.Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func speechSynthesizer(_ speechSynthesizer: SpeechSynthesizing, willSpeak instruction: SpokenInstruction) -> SpokenInstruction?Parameters
speechSynthesizerThe speech synthesizer that will speak an instruction.
instructionThe spoken instruction that will be said.
Install in Dash
SpeechSynthesizingDelegate Protocol Reference