You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# Changes to the Mapbox Navigation SDK for iOS
2
2
3
3
## Unreleased
4
+
- The `speak` method in `RouteVoiceController` can be used without a given `RouteProgress` or the `RouteProgress` can explicitly ignored so that it will not be added to the voice instruction.
5
+
-`RouteProgress` is now optional in `willSpeak` method of `VoiceControllerDelegate` if the `RouteProgress` in the `speak` method of the `RouteVoiceController is `nil`.
4
6
- Uses the `Locale` given in `RouteOptions` to create the corresponding `AVSpeechSynthesisVoice`.
Copy file name to clipboardexpand all lines: MapboxNavigation/RouteVoiceController.swift
+19-26
Original file line number
Diff line number
Diff line change
@@ -192,13 +192,9 @@ open class RouteVoiceController: NSObject, AVSpeechSynthesizerDelegate {
192
192
193
193
- parameter instruction: The instruction to read aloud.
194
194
- parameter locale: The `Locale` used to create the voice read aloud the given instruction. If `nil` the `Locale.preferredLocalLanguageCountryCode` is used for creating the voice.
195
+
- parameter ignoreProgress: A `Bool` that indicates if the routeProgress is added to the instruction.
195
196
*/
196
-
openfunc speak(_ instruction:SpokenInstruction, with locale:Locale?){
197
-
guardlet routeProgress else{
198
-
assertionFailure("routeProgress should not be nil.")
199
-
return
200
-
}
201
-
197
+
openfunc speak(_ instruction:SpokenInstruction, with locale:Locale?, ignoreProgress:Bool=false){
202
198
if speechSynth.isSpeaking,let lastSpokenInstruction = lastSpokenInstruction {
@@ -264,8 +257,8 @@ public protocol VoiceControllerDelegate {
264
257
265
258
- parameter voiceController: The voice controller that will speak an instruction.
266
259
- parameter instruction: The spoken instruction that will be said.
267
-
- parameter routeProgress: The `RouteProgress` just before when the instruction is scheduled to be spoken.
260
+
- parameter routeProgress: The `RouteProgress` just before when the instruction is scheduled to be spoken. Could be `nil` if no progress is available or if it should be ignored.
0 commit comments