I’ve been updating a project from an older version of Haxe/OpenFL and whilst most if it has been fine, I’ve not got the sounds to work, I get this error:
ERROR: There is no SOUND asset with an ID of “sound/btn.mp3”
I think this is probably to do with my project.xml which I’ve compared against PiratePig…
in PP I can see the sounds are defined explicitly, with each mp3 being assigned to a key. Because I have quite a lot more sounds than this, I originally did this generically, which did work - but now doesn’t (when I checked it was using sound.js rather than howler, so it is pretty old!)
I was using this:
but wondered is there a better way of doing this?? (I have different audio files for different browsers, WAV/OGG/MP3)
EDIT: I use option 2 to make it easier to specify the file in my code by using the id “sound1” no matter which type. You can use option 1 but need to add code and a var to specify which file extension.
thanks @dean
so there’s 2 things:
is a clearer way to aggregate? I’ve got a reasonable number of sounds, so I’d rather go with option 1 in some form, but… different browsers prefer different audio types, so how could I specify mp3 for ie11, ogg for FF etc.?
whilst I appreciate that windows !== mobile !== html5 how best to differentiate? Is there any guidance about how best to subdivide?
I know what you mean that using option one is easier with lots of sounds so you can just add to the sounds folder without editing project.xml every time you add a sound.
I’m not sure of the best way to go about it, I still use option 2 even though I have a lot of sounds.
Is there a reason to use different types for different browsers? I the same for all broswers: ogg (html5) and mp3 (flash).