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

Delay timbre library load to fix initialization bug #4

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

shamgang
Copy link

Fixes #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.

Fixes tgwizard#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AudioContext fails to start in guess the tempo
1 participant