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

Error: Unhandled Promise Rejection: InvalidStateError: Failed to start the audio device - interrupted context state - #1743

Open
aiferrer opened this issue Nov 8, 2024 · 0 comments
Labels

Comments

@aiferrer
Copy link

aiferrer commented Nov 8, 2024

The Problem

I have an issue in my app when I use the iPad (only on iPad) and press the home button to close and reopen the app.
Error: Unhandled Promise Rejection: InvalidStateError: Failed to start the audio device
AudioContext state: – "interrupted"
I was testing the Howler TESTs on the iPad and I have the error in the console for both the WEB AUDIO TEST and the Spatial Audio TEST from howler examples, you can reproduce this error.

iPad - iPadOS 17.7.1

Reproducible Example

https://howlerjs.com/assets/howler.js/examples/3d/

Reproduction Steps

Use an iPad with S.O: iPadOS 17.7.1
Use a Safari Tecnology Preview and use Develop Tool to open a console linked to your iPad.
Open https://howlerjs.com/assets/howler.js/examples/3d/ -> SPATIAL AUDIO TEST
or BASIC FUNCTIONS -> RUN WEB AUDIO TESTS

Press HOME button in your iPad to bring the app to the background and wait for a few seconds... you will see this error in console.
Error: Unhandled Promise Rejection: InvalidStateError: Failed to start the audio device

And the audio will disappear..

Possible Solution

Improve the _autoResume function especially to more robustly handle the interrupted state on iOS.

Context

It affects the development of a language learning game.

Howler.js Version

v2.2.4

Affected Browser(s)/Versiuon(s)

iPadOS 17.7.1

@aiferrer aiferrer added the bug label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant