mattgodbolt / jsbeeb

Javascript BBC micro emulator
GNU General Public License v3.0
352 stars 68 forks source link

Chrome needs interaction to start audio #184

Closed mattgodbolt closed 5 years ago

mattgodbolt commented 5 years ago

Latest chromes complain about not being able to start audio until an interaction.

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
BigEd commented 5 years ago

ah, this maybe explains why I get no beeb until I change model!

mattgodbolt commented 5 years ago

Right, or click somewhere in the ui. not sure what to do about this...

richtw1 commented 5 years ago

I was overriding this Chrome behaviour with a flag, but they seem to have removed it now, and Chrome seems to decide 50/50 whether to allow sound or not now.

You can type: soundChip.jsAudioNode.context.resume() at the console to get sound back. I wonder whether it's worth just adding that in keyDown()?

mattgodbolt commented 5 years ago

That's a great idea! Thanks. This might also fix #186 . We can also pop a UI element that explains the lack of sound if we notice the node is paused