Howler.js: Chrome 52: audio can't be heard after _autoResume

Created on 5 Aug 2016  路  8Comments  路  Source: goldfire/howler.js

In Chrome 52 (52.0.2743.82 (64-bit) and 52.0.2743.116 (64-bit)), if the browser tab sits idle (no audio and no user interaction) for 30+ seconds, then audio played through the web audio API won't be audible. The events for the different states of the audio clip work, but the sound doesn't make it to the speakers. From adding some breakpoints, the _autoSuspend and _autoResume functions do get called at appropriate times. Attached are two test cases. One (chrome_audio_bug_test_no_howler) directly uses the web audio api and audio is audible after 30+ seconds of inactivity. The other allows for switching between using web audio API and HTML5 audio. HTML5 works fine. For the web audio API case, using the developer tools I had manually disabled the suspend functionality by changing the value of autoSuspend and that did resolve this problem but the "browser-specific bugs" portion of the function comment makes me not want to do that outside of a test case. I didn't notice this problem in Chrome 51.

chrome_audio_bug_test_no_howler.zip
chrome_audio_bug_test.zip

Most helpful comment

+1
I've been setting autosuspend to false as a temporary solution.
https://github.com/goldfire/howler.js#autosuspend-boolean-true

All 8 comments

+1. For me it only happens for audio downloaded from S3 and not local audio.

Until this is fixed, I may use a setTimeout TICK to trigger a token/empty audio every X seconds -- keeping in mind Chrome may throttle setTimeout when the browser is not in focus.

I'm seeing this too. Has this bug been reported to the Chromium project?

This is happening to me as well. 52.0.2743.116 (64-bit). Tried using a setInterval for a tick, but that solution hasn't worked for me. I tried recreating howl objects when the tab was refocused, but no dice on that either.

I worked around this by playing an audio file with no sound every 20 seconds (created it by telling audacity to record for 1 second while in the system settings I had set the mic volume to 0).

@nmrugg I had filed an issue with Chromium when I thought the problem was with the web audio API. Since it turned out to not be that API, that bug is closed. I didn't open a different one for the suspend/resume not working as expected since I hadn't gotten familiar with that code or narrowed down which part is the problem with Chrome 52.

@mnewcomb314 @benlinton @spacewaffle I just download 53.0.2785.46 beta and the audio is working fine! I am asking them to backport the bug fix.

+1
I've been setting autosuspend to false as a temporary solution.
https://github.com/goldfire/howler.js#autosuspend-boolean-true

Couldn't find it in the docs, but you can set the autoSuspend global option like this:

Howler.autoSuspend = false;

This worked for me as well.

Was this page helpful?
0 / 5 - 0 ratings