mapbox / mapbox-navigation-ios

Turn-by-turn navigation logic and UI in Swift on iOS
https://docs.mapbox.com/ios/navigation/
Other
864 stars 312 forks source link

[Bug]: Conflict Between WebRTC Audio and Mapbox Navigation Audio Playback #4736

Open ProgrammerFaraz opened 23 hours ago

ProgrammerFaraz commented 23 hours ago

Mapbox Navigation SDK version

2.0.1

I'm facing an issue while integrating WebRTC audio streaming and Mapbox Navigation audio in the same iOS application. When the Mapbox Navigation SDK plays audio (e.g., turn-by-turn instructions), it interrupts and stops the audio and mic of the ongoing WebRTC audio stream that uses AVAudioSession. This behavior negatively impacts the user experience, especially in scenarios where continuous communication via WebRTC is crucial alongside navigation.

Steps to reproduce

Expected behavior

Mapbox Navigation audio should coexist with WebRTC audio:

Actual behavior

Is this a one-time issue or a repeatable issue?

repeatable

kried commented 5 hours ago

Hi @ProgrammerFaraz

You described the expected behavior of the SDK. The navigation instruction interrupts other audio sessions on device. This is the default SDK behavior. If you want to change this, feel free to write your custom SpeechSynthesizing implementation. Take a look at the sample.

ProgrammerFaraz commented 5 hours ago

Hi @kried Thanks for the guidance. I'll surely try creating a custom SpeechSynthesizing and see how it works.