-
Notifications
You must be signed in to change notification settings - Fork 831
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
Sound problems #368
Comments
I believe I have figured that out. "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page." |
Solution for me: document.documentElement.addEventListener(
"mousedown", function(){
mouse_IsDown = true;
if (audio_ctx.state !== 'running') {
audio_ctx.resume();
}});
document.documentElement.addEventListener(
"keydown", function(){
if (audio_ctx.state !== 'running') {
audio_ctx.resume();
}}); |
Do you think we need this on jsnes.org? |
I think I do, sir, since it seemed like an annoying thing to me as I was really puzzled at first and couldn't find the reason as I am a complete javascript (and debugging it) noob. It looked like a real bug, and it will definitely scare the user away. By the way, it will be nice if you update your page with new things for the NES. During this time, good demos and games were released. |
thanks for this project! I'm also noticing sound issues in Safari and webkit-based browsers (seems like this could be the case on jsnes.org too). Adding the webkit prefix to AudioContext fixed it for me: var AudioContext = window.AudioContext
|| window.webkitAudioContext
|| false;
if (AudioContext) {
var audio_ctx = new AudioContext;
} |
Strange sound problems with Chrome browser. There is no sound if you open the ROM page directly. But if you go to the ROM page from another page, the sound appears.
The text was updated successfully, but these errors were encountered: