RouteVoiceController
@objc(MBRouteVoiceController)
open class RouteVoiceController : NSObject, AVSpeechSynthesizerDelegate, AVAudioPlayerDelegate
The RouteVoiceController
class provides voice guidance.
-
A boolean value indicating whether instructions should be announced by voice or not.
Declaration
Swift
@objc public var isEnabled: Bool
-
Volume of announcements.
Declaration
Swift
@objc public var volume: Float
-
SSML option which controls at which speed Polly instructions are read.
Declaration
Swift
@objc public var instructionVoiceSpeedRate: Double
-
SSML option that specifies the voice loudness.
Declaration
Swift
@objc public var instructionVoiceVolume: String
-
If true, a noise indicating the user is going to be rerouted will play prior to rerouting.
Declaration
Swift
@objc public var playRerouteSound: Bool
-
Sound to play prior to reroute. Inherits volume level from
volume
.Declaration
Swift
@objc public var rerouteSoundPlayer: AVAudioPlayer
-
Buffer time between announcements. After an announcement is given any announcement given within this
TimeInterval
will be suppressed.Declaration
Swift
@objc public var bufferBetweenAnnouncements: TimeInterval
-
Delegate used for getting metadata information about a particular spoken instruction.
Declaration
Swift
public weak var voiceControllerDelegate: VoiceControllerDelegate?
-
Default initializer for
RouteVoiceController
.Declaration
Swift
override public init()
-
Reads aloud the given instruction.
Declaration
Swift
open func speak(_ instruction: SpokenInstruction)
Parameters
instruction
The instruction to read aloud.