New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't speak over each other #1213
Conversation
@@ -171,6 +169,9 @@ open class MapboxVoiceController: RouteVoiceController { | |||
Plays an audio file. | |||
*/ | |||
@objc open func play(_ data: Data) { | |||
|
|||
guard !super.speechSynth.isSpeaking else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we could change this to:
super.speechSynth.stopSpeaking(at: .immediate)
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's do that.
@@ -186,6 +187,7 @@ open class MapboxVoiceController: RouteVoiceController { | |||
let played = self.audioPlayer?.play() ?? false | |||
|
|||
guard played else { | |||
try super.unDuckAudio() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We ducked a few lines above, so unduck before playing super.speak.
@vincethecoder could you give this a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a few reports of the the RouteVoiceController and the MapboxVoiceController are speaking over each other in a few cases:
It's difficult to reproduce but these are changes that I see as pretty valid changes.
/cc @mapbox/navigation-ios @lyzidiamond