VoiceControllerDelegate
public protocol VoiceControllerDelegate : AnyObject, UnimplementedLogging
The VoiceControllerDelegate protocol defines methods that allow an object to respond to significant events related to spoken instructions.
-
voiceController(_:didFallBackTo:error:)Default implementationCalled when the voice controller falls back to a backup speech syntehsizer, but is still able to speak the instruction.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func voiceController(_ voiceController: RouteVoiceController, didFallBackTo synthesizer: AVSpeechSynthesizer, error: SpeechError)Parameters
voiceControllerThe voice controller that experienced the failure.
synthesizerthe Speech engine that was used as the fallback.
errorAn error explaining the failure and its cause.
-
voiceController(_:spokenInstructionsDidFailWith:)Default implementationCalled when the voice controller failed to speak an instruction.
Default Implementation
UnimplementedLoggingprints a warning to standard output the first time this method is called.Declaration
Swift
func voiceController(_ voiceController: RouteVoiceController, spokenInstructionsDidFailWith error: SpeechError)Parameters
voiceControllerThe voice controller that experienced the failure.
errorAn error explaining the failure and its cause.
-
voiceController(_: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 voiceController(_ voiceController: RouteVoiceController, didInterrupt interruptedInstruction: SpokenInstruction, with interruptingInstruction: SpokenInstruction)Parameters
voiceControllerThe voice controller that experienced the interruption.
interruptedInstructionThe spoken instruction currently in progress that has been interrupted.
interruptingInstructionThe spoken instruction that is interrupting the current instruction.
-
voiceController(_:willSpeak:routeProgress:)Default implementationCalled when a spoken is about to speak. Useful if it is necessary to give a custom instruction instead. Noting, 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 voiceController(_ voiceController: RouteVoiceController, willSpeak instruction: SpokenInstruction, routeProgress: RouteProgress) -> SpokenInstruction?Parameters
voiceControllerThe voice controller that will speak an instruction.
instructionThe spoken instruction that will be said.
routeProgressThe
RouteProgressjust before when the instruction is scheduled to be spoken.
Install in Dash
VoiceControllerDelegate Protocol Reference