android - openfl - audio doesn't work on cpp target -


i've added <assets path="assets/audio" rename="audio" /> application.xml file.

and load "mp3" files in audio folder calling assets.getsound("2_3_1.mp3");, , use .play(); method on (sound) object play file.

the sounds play in flash target. don't play on cpp targets. i'm targeting android (cpp) , ios (c#) targets app.

when debugging windows (cpp) target, shows these errors in console:

sound.hx:99: error: not load "audio/2_3_1.mp3" error opening sound file, unsupported type. error opening sound data done(0) 

i believe mp3 isn't supported on windows , other targets due decision related licensing costs format.

the flash target exception since adobe has agreement allows developers use format without paying royalties. discussed more here: http://www.openfl.org/blog/2013/09/18/to-mp3-or-not-to-mp3/

a workaround use .ogg format non-flash platforms audio, , include audio files each platform specifying asset paths in project.xml e.g:

<assets path="assets/music" type="music" if="flash"> <!-- mp3s --> </assets> <assets path="assets/music" type="music" unless="flash"> <!-- oggs --> </assets>


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -