RouteVoiceController
open class RouteVoiceController : NSObject, AVSpeechSynthesizerDelegate
extension RouteVoiceController: AVAudioPlayerDelegate
A route voice controller monitors turn-by-turn navigation events and triggers playing spoken instructions as audio using the instance of SpeechSynthesizing type.
You initialize a voice controller using a NavigationService instance. The voice controller observes when the navigation service hints that the user has passed a spoken instruction point and responds by calling it’s speechSynthesizer to handle the vocalization.
If you want to use your own custom SpeechSynthesizing implementation - also pass it during initialization. If no implementation is provided - MultiplexedSpeechSynthesizer will be used by default.
You can also subclass RouteVoiceController to implement you own mechanism of monitoring navgiation events and calling speechSynthesizer.
-
Default initializer for
RouteVoiceController.Declaration
Swift
public init(navigationService: NavigationService, speechSynthesizer: SpeechSynthesizing? = nil, accessToken: String? = nil, host: String? = nil)
-
SpeechSynthesizingimplementation, used to vocalize the spoken instructions. Defaults toMultiplexedSpeechSynthesizerDeclaration
Swift
public let speechSynthesizer: SpeechSynthesizing -
Delegate used for getting metadata information about route vocalization
Declaration
Swift
public weak var routeVoiceControllerDelegate: RouteVoiceControllerDelegate?
-
If true, a noise indicating the user is going to be rerouted will play prior to rerouting.
Declaration
Swift
public var playRerouteSound: Bool -
Sound to play prior to reroute. Inherits volume level from
volume.Declaration
Swift
public var rerouteSoundPlayer: AVAudioPlayer
Install in Dash
RouteVoiceController Class Reference