Ok I will try this Evgeni. Edit: It worked. Thanks very much.
I also have a similar question. Currently you can only add one audio format.
But if you use mp3, it won’t work on firefox, ogg will work for him.
But if we use the ogg, it will not work on Chrome, but will work on firefox.
The audio of html5 allows to put several audio sources. If a format is not supported, the second source is test.
BY having several formats for a BABYLON.Sound, it would make it possible to be sure that a format is read.
Is this something already possible or could it be supported?
The Sound constructor’s urlOrArrayBuffer argument can be an <audio> element, so you can create an <audio> element with multiple sources and pass it in if you want. I haven’t tried it myself, yet, but the code indicates it should work.
Using an array of URLs like that works for .mp3 and .ogg files if skipCodecCheck is set to false. The URLs in the array are checked for compatibility in the order they’re given, so you may want to put the .ogg file before the .mp3 file, like ["sound.ogg", "sound.mp3"], that way the .ogg file will be used if the browser supports it, and the fallback will be the .mp3 file. If you put the .mp3 file before the .ogg file, then browsers that support both formats will only use the .mp3 file since it comes before the .ogg file in the array.