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

Circumvent new autoplay restrictions on modern browsers #68

Open
PurgingPanda opened this issue Aug 19, 2023 · 0 comments
Open

Circumvent new autoplay restrictions on modern browsers #68

PurgingPanda opened this issue Aug 19, 2023 · 0 comments

Comments

@PurgingPanda
Copy link

PurgingPanda commented Aug 19, 2023

When I try to play the music on: http://bbloomf.github.io/jgabc/transcriber.html

I get the error: "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. "

Related Stackoverflow: https://stackoverflow.com/questions/55026293/google-chrome-javascript-issue-in-getting-user-audio-the-audiocontext-was-not

If I understand correctly the Audiocontext in Tone.min.js with line !i.context && (i.context = new window.AudioContext, should be created when the user clicks something to circumvent this error.

EDIT: The tones.js library shows how to fix this: https://github.com/Tonejs/Tone.js#starting-audio

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

No branches or pull requests

1 participant