Fix: Same first voice instruction is played in Offline and Online player.#6758
Fix: Same first voice instruction is played in Offline and Online player.#6758tomaszrybakiewicz wants to merge 1 commit intomainfrom
Conversation
…ls to both MapboxSpeechApi and MapboxVoiceInstructionsPlayer. As a result, MapboxAudioGuidanceVoice will wait until the player finishes playing the previous announcement before attempting to play the next one. Using coroutines also allows for API and Player cancellation alongside the parent Job.
Guardiola31337
left a comment
There was a problem hiding this comment.
Noting that I tested this downstream in 1TAP with a SNAPSHOT and can't reproduce NAVAND-1001 🎉
|
It does not fix the root cause of instruction being played twice, although it does reduce the probability of such a situation. |
|
BTW, soon we might want to interrupt the instruction if the new one arrives (https://mapbox.atlassian.net/browse/NAVSDK-775). |
|
I've opened a draft PR that would fix the issue that a described here: #6766. |
Looking good to me, I've tested downstream in 1TAP with a |
| lastPlayedInstructions = it.voiceInstructions | ||
| audioGuidance.speak(it.voiceInstructions) | ||
| val announcement = audioGuidance.speak(it.voiceInstructions) | ||
| flowOf(announcement) |
There was a problem hiding this comment.
Since you emit a flow with a single value, you can use a simple map instead of flatMapConcat.
After that you can replace two consecutive maps with one map.
|
Closing in favor of #6766 |
Closes NAVAND-1001
Description
Updated
MapboxAudioGuidanceVoiceto use coroutines to synchronize calls to bothMapboxSpeechApiandMapboxVoiceInstructionsPlayer. As a result,MapboxAudioGuidanceVoicewill wait until the player finishes playing the previous announcement before attempting to play the next one. Using coroutines also allows API and Player cancellation alongside the parentJob.