Skip to content
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

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

Open
ProgrammerFaraz opened this issue Nov 21, 2024 · 2 comments

Comments

@ProgrammerFaraz
Copy link

ProgrammerFaraz commented Nov 21, 2024

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

  • Integrate WebRTC audio streaming using WebRTC's RTCAudioSession.
  • Add Mapbox Navigation SDK to the project.
  • Start a WebRTC audio stream.
  • Trigger a navigation session that plays audio instructions (e.g., "Turn left in 100 meters").

Expected behavior

Mapbox Navigation audio should coexist with WebRTC audio:

  • Both audio streams should play simultaneously without interruption.
  • Navigation audio should not interfere with WebRTC audio streams.

Actual behavior

  • Mapbox Navigation audio interrupts and stops the volume and mic of the WebRTC audio stream.
  • After navigation audio finishes, WebRTC audio does not fully recover and it stops entirely.

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

repeatable

@ProgrammerFaraz ProgrammerFaraz added the bug Something isn’t working label Nov 21, 2024
@kried kried removed the bug Something isn’t working label Nov 22, 2024
@kried
Copy link
Contributor

kried commented Nov 22, 2024

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants