So while working on FlossyFX I was trying to see if there was a way to import .wav or .aiff files into AIR to play in Flossy. Since those file types aren't native I was trying to look for alternate ways to get this going.
At first I thought I could write a hook to lame to convert the file into an MP3 then import into AIR. But from what I read security is tight, so that was a no go. Boo!
Then I saw
Merapi, a project that allows a bridge between Java and AIR. So I signed up for the beta. I am still waiting for the beta email, but while waiting I found
Benjamin Dobler's Rich Apps blog. Benjamin broke down how to take the byte array information from a wav file and stuff it down to a swf for the sound to play. This totally answered my issue of getting wav files working.
Now I am in the process of taking the wav conversion code and converting the idea over to aif files as well. The binary structure of an aif file is way more organized then wav is it seemed fairly easy to get to the byte data. I just have to make sure it's saving the data in all the right places. If I get the code done I will post the solution.
Here is the
post on the wav conversion. I did have to change the code a bit in Benjamin's WavSWF Class and add the LoaderContentInfo to the Loader because of the new security settings in AIR.
FYI, if you are looking for more information on ByteArrays check out
http://bytearray.org/Labels: ByteArray, Flex, FlossyFX