SpeechSynthesizing
public protocol SpeechSynthesizing : AnyObject
Protocol for implementing speech synthesizer to be used in RouteVoiceController.
-
A delegate that will be notified about significant events related to spoken instructions.
Declaration
Swift
var delegate: SpeechSynthesizingDelegate? { get set } -
Controls muting playback of the synthesizer
Declaration
Swift
var muted: Bool { get set } -
Controls volume of the voice of the synthesizer. Should respect
NavigationSettings.voiceVolumeDeclaration
Swift
var volume: Float { get set } -
Returns
trueif synthesizer is speakingDeclaration
Swift
var isSpeaking: Bool { get } -
Locale setting to vocalization. This locale will be used as ‘default’ if no specific locale is passed for vocalizing each individual instruction.
Declaration
Swift
var locale: Locale? { get set } -
Controls if this speech synthesizer is allowed to manage the shared
AVAudioSession. Set this field tofalseif you want to manage the session yourself, for example if your app has background music. Default value istrue.Declaration
Swift
var managesAudioSession: Bool { get set } -
Used to notify speech synthesizer about future spoken instructions in order to give extra time for preparations.
It is not guaranteed that all these instructions will be spoken. For example navigation may be re-routed. This method may be (and most likely will be) called multiple times along the route progress
Declaration
Swift
func prepareIncomingSpokenInstructions(_ instructions: [SpokenInstruction], locale: Locale?)Parameters
instructionsAn array of
SpokenInstructions that will be encountered further.localeA locale to be used for preparing instructions. If
nilis passed -SpeechSynthesizing.localewill be used as ‘default’. -
A request to vocalize the instruction
This method is not guaranteed to be synchronous or asynchronous. When vocalizing is finished,
voiceController(_ voiceController: SpeechSynthesizing, didSpeak instruction: SpokenInstruction, with error: SpeechError?)should be called.Declaration
Swift
func speak(_ instruction: SpokenInstruction, during legProgress: RouteLegProgress, locale: Locale?)Parameters
instructionan instruction to be vocalized
legProgresscurrent leg progress, corresponding to the instruction
localeA locale to be used for vocalizing the instruction. If
nilis passed -SpeechSynthesizing.localewill be used as ‘default’. -
Tells synthesizer to stop current vocalization in a graceful manner
Declaration
Swift
func stopSpeaking() -
Tells synthesizer to stop current vocalization immediately
Declaration
Swift
func interruptSpeaking()
Install in Dash
SpeechSynthesizing Protocol Reference