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

Audio not working on AVP in immersive mode #14927

Closed
docEdub opened this issue Mar 28, 2024 · 5 comments · Fixed by #15168
Closed

Audio not working on AVP in immersive mode #14927

docEdub opened this issue Mar 28, 2024 · 5 comments · Fixed by #15168
Assignees
Milestone

Comments

@docEdub
Copy link
Contributor

docEdub commented Mar 28, 2024

Repro
https://playground.babylonjs.com/#KR5CRQ#17:

  • Audio should work in immersive mode (bells should ring when clicked and birds should be singing in background)
  • Currently, audio only works in non-immersive mode.
  • After clicking on a few bells in immersive mode, exiting immersive mode causes all the clicked bells to ring at the same time.
@docEdub docEdub self-assigned this Mar 28, 2024
Copy link

This issue has been automatically staled because it has been inactive for more than 14 days. Please update to "unstale".

@github-actions github-actions bot added the stale label Apr 26, 2024
@bghgary bghgary added bug and removed stale labels Apr 29, 2024
@bghgary bghgary added this to the 8.0 milestone Apr 29, 2024
Copy link

This issue has been automatically staled because it has been inactive for more than 14 days. Please update to "unstale".

@github-actions github-actions bot added the stale label May 28, 2024
@deltakosh
Copy link
Contributor

Up as this is a bug it should be prioritized

@docEdub
Copy link
Contributor Author

docEdub commented Jun 5, 2024

I looked into this and found Safari is suspending the audio context when entering immersive mode. This occurs with any XR experience that uses the Web Audio API, so it's not a Babylon-specific issue.

I was able to resume the audio context from the JS console while debugging in immersive mode, so we should be able to do the same in the Babylon audio engine.

Note that the Quest browser doesn't have this issue and won't be affected by repeated calls to AudioContext.resume() while it's already running since they will just be ignored, so no worries there for a potential workaround.

I'll discuss it with @RaananW to see what he thinks about addressing this AVP Safari behavior/feature.

@matthargett
Copy link

Thanks for digging into this and fixing it. We noticed this a few months ago in our BabylonJS WebXR app, but hadn't gotten around to investigating since most of our ideal customers are using Pico 4s (and that browser doesn't have this problem).

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

Successfully merging a pull request may close this issue.

4 participants