I’m currently facing an issue with the audio. At the moment, I need to click on the small mute/unmute button in the top left corner of the scene to mute/unmute the audio of my game.
The issue is that I would my audio to play when it is ready without having to enable/disable the button. At the moment, I’m able to remove the audio button via this line of code
There’s no line that makes that possible, as every browser requires an user interaction to start audio Which is a good thing if you think about it, imagine if ads could just start blaring audio at full volume
Ooooh, my bad, I understood you were asking something different I dug a bit more in the audio engine, and I could get it to play on click by calling unlock on pointer down: Sounds not ready to play | Babylon.js Playground (babylonjs.com) (it looks like that doesn’t work if the unlock isn’t inside a user interaction, which makes sense)
Hi,
May be ask @RaananW ? I had the understanding that we would get a refounded (actually new founded) audio component, isn’t it? Since I’m not into making audio at this time I didn’t follow-up.
I think Babylon should simply provide an option like audioEngine.noMute = true and simply never show that pesky unmute button by default. It should simply work out of the box.
No one wants that unmute button by default. It’s a bother, and difficult to get right.
What is worse is that, if you call unlock() in pointerdown on iPhone, it never works again. The unmute button doesn’t even work after that!! Click it and it never goes away!!