You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following warning appears every time for me on the first attempt in the guess the tempo game.
"The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page."
When this warning appears, the audio fails to play and the game hangs.
If I click the "<< Back" link and then choose the game again, it works correctly
The reason for this is that the Timbre.js library starts an AudioContext on load, which happens before a user interaction,
and Chrome now blocks autoplay of audio before a user interaction.
If I let the game crash and go back and select it again, Chrome considers the first attempt a user interaction
so it works the second time.
This should be fixed in the timbre repo by
either delaying the AudioContext start or using resume() later on before playing audio.
However timbre is no longer maintained, so I've prepared a patch fix. Pull request coming soon.
Using Chrome 97.0.4692.99
The text was updated successfully, but these errors were encountered:
shamgang
added a commit
to shamgang/bpm-game
that referenced
this issue
Jan 30, 2022
Fixestgwizard#3
The timbre library attemps to start an AudioContext on load.
This fails in newer versions of Chrome because autoplay is blocked
until the user has made an interaction.
The best fix is for the timbre library to wait for interaction
or call context.resume() before attempting to play audio.
However, the timbre repo is no longer maintained.
As a patch fix, dynamically load the library after the first
interaction in the guess tempo game (READY is clicked).
The timbre library is removed entirely from the keep bpm game
as it is not used.
The following warning appears every time for me on the first attempt in the guess the tempo game.
"The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page."
When this warning appears, the audio fails to play and the game hangs.
If I click the "<< Back" link and then choose the game again, it works correctly
The reason for this is that the Timbre.js library starts an AudioContext on load, which happens before a user interaction,
and Chrome now blocks autoplay of audio before a user interaction.
If I let the game crash and go back and select it again, Chrome considers the first attempt a user interaction
so it works the second time.
This should be fixed in the timbre repo by
either delaying the AudioContext start or using resume() later on before playing audio.
However timbre is no longer maintained, so I've prepared a patch fix. Pull request coming soon.
Using Chrome 97.0.4692.99
The text was updated successfully, but these errors were encountered: