I’m loading a sound using the AssetsManager (as per this doc page - Audio | Babylon.js Documentation ).
However, in this case they’re running the ‘sound.play()’ in a function that runs within the asset ‘loading’ function instantiation. I wanted to be able to use the ‘.play()’ function in a different place to be more flexible but I’m not getting any sound playback.
Even doing it as explained in this video - Sound FX with 2 Lines of Code! - YouTube the sound never plays.
What’s the proper way to play sound when not in the callback of the ‘new BABYLON.Sound()’ instantiation?
How would one make it so that, as an example, a sound would be played whenever there’s a physics collision detected?
I’m not sure I’m understanding how this is supposed to work, I find it weird that the file/data has to be loaded every time the sound needs to be played…
Any suggestions would be much appreciated.