howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

Sound cuts out on Android after a screen dim

Open galinawind opened this issue 11 years ago • 4 comments

We're experiencing an issue with sound playback on Android. After the device had been idle for a while, the audio on the website cuts out and there is nothing one can do to start it back up short of completely reloading the page. It appears to be related to the screen dimming. As soon as the screen dims, if the audio was playing at the moment the screen dimmed, it will resume playing, but if the screen dimmed and the audio was not playing, all sound is lost for the rest of the website. It's like Android somehow kills the audio context when it dims the screen. Installing an app such as Stay Alive! that prevents the screen from dimming does not appear to remedy the issue, probably because the app is dealing with screen only, not with the audio context. Any ideas?

galinawind avatar Oct 29 '15 20:10 galinawind

Have you been using 1.x or 2.0? Also, do you know if this happens exclusively with Web Audio or with HTML5 Audio as well? Chrome or Android browser?

goldfire avatar Nov 14 '15 00:11 goldfire

Looks like this is probably related to #391.

goldfire avatar Nov 16 '15 19:11 goldfire

I've found that using suspend/resume can solve this issue, but am still thinking through the best way to handle it. I've outlined my initial thoughts on how to approach the problem in #315.

goldfire avatar Nov 20 '15 23:11 goldfire

This should now be fixed in 7022ab9fb756e12013b4d455b2765b27827c0ac7.

goldfire avatar Dec 06 '15 22:12 goldfire