A module for using the Mapbox Speech API specifically tuned for the Mapbox Navigation SDK.
- We wanted to upgrade the SDK from iOS 9.0 to 12.0.
- Upgrade iOS version from 9.0 to 12.0.
If you are looking to include this inside your project, you have to follow the the following steps:
Specify the following dependency in your Carthage Cartfile:
github "mapbox/MapboxSpeech.swift" ~> 0.1
Or in your CocoaPods Podfile:
pod 'MapboxSpeech.swift', '~> 0.1'Then import MapboxSpeech or @import MapboxSpeech;.
// main.swift
import MapboxSpeech
let voice = SpeechSynthesizer(accessToken: "Your Mapbox access token")
let options = SpeechOptions(text: "hello, my name is Bobby")
voice.audioData(with: options) { (data: Data?, error: NSError?) in
// Do something with the audio!
}Copyright (c) 2023 MapLibre contributors