RouteVoiceController
open class RouteVoiceController: NSObject, AVSpeechSynthesizerDelegate
The RouteVoiceController
class provides voice guidance.
-
A boolean value indicating whether instructions should be announced by voice or not.
Declaration
Swift
public var isEnabled: Bool = true
-
Volume of announcements.
Declaration
Swift
public var volume: Float = 1.0
-
SSML option which controls at which speed Polly instructions are read.
Declaration
Swift
public var instructionVoiceSpeedRate = 1.08
-
SSML option that specifies the voice loudness.
Declaration
Swift
public var instructionVoiceVolume = "x-loud"
-
If true, a noise indicating the user is going to be rerouted will play prior to rerouting.
Declaration
Swift
public var playRerouteSound = true
-
Sound to play prior to reroute. Inherits volume level from
volume
.Declaration
Swift
public var rerouteSoundPlayer: AVAudioPlayer = try! AVAudioPlayer(data: NSDataAsset(name: "reroute-sound", bundle: .mapboxNavigation)!.data, fileTypeHint: AVFileTypeMPEGLayer3)
-
Buffer time between announcements. After an announcement is given any announcement given within this
TimeInterval
will be suppressed.Declaration
Swift
public var bufferBetweenAnnouncements: TimeInterval = 3
-
Default initializer for
RouteVoiceController
.Declaration
Swift
override public init()