MapboxSpeechSynthesizer

open class MapboxSpeechSynthesizer : NSObject, SpeechSynthesizing
extension MapboxSpeechSynthesizer: AVAudioPlayerDelegate

SpeechSynthesizing implementation, using MapboxSpeech framework. Uses pre-caching mechanism for upcoming instructions.

  • Declaration

    Swift

    public weak var delegate: SpeechSynthesizingDelegate?
  • Declaration

    Swift

    public var muted: Bool { get set }
  • Declaration

    Swift

    public var volume: Float { get set }
  • Declaration

    Swift

    public var locale: Locale?
  • Number of upcoming Instructions to be pre-fetched.

    Higher number may exclude cases when required vocalization data is not yet loaded, but also will increase network consumption at the beginning of the route. Keep in mind that pre-fetched instuctions are not guaranteed to be vocalized at all due to re-routing or user actions. “0” will effectively disable pre-fetching.

    Declaration

    Swift

    public var stepsAheadToCache: UInt
  • An AVAudioPlayer through which spoken instructions are played.

    Declaration

    Swift

    public var audioPlayer: AVAudioPlayer?
  • Controls if this speech synthesizer is allowed to manage the shared AVAudioSession. Set this field to false if you want to manage the session yourself, for example if your app has background music. Default value is true.

    Declaration

    Swift

    public var managesAudioSession: Bool
  • Mapbox speech engine instance.

    The speech synthesizer uses this object to convert instruction text to audio.

    Declaration

    Swift

    public private(set) var remoteSpeechSynthesizer: SpeechSynthesizer { get }