The Flash IDE is capable of embedding many types of uncompressed sound files, including wav, and offers optional compression when publishing.
However, the [Embed] tag, only seems to allow embedding of mp3 files. Is it truly impossible to embed an uncompressed wav file, or am I missing some magic, undocumented mimeType?
I was hoping for something like:
[Embed source="../../audio/wibble.wav" mimeType="audio/wav"]
...but I get
no transcoder registered for mimeType 'audio/wav'
It's possible to embed wav or other format as an octet-stream and parse at runtime, but that's pretty heavy handed I think.
I'm surprised that even though the Flash IDE can embed uncompressed sound data, [Embed] cannot, given that the swf spec can contain uncompressed sound data.
From the LiveDocs - Basics of working with sound:
[...] Although there are various sound file formats used to encode digital audio, ActionScript 3.0, Flash Player and AIR support sound files that are stored in the mp3 format. They cannot directly load or play sound files in other formats like WAV or AIFF. [...]
But apparently there's a workaround. Check post #3 in this thread from actionscript.org:
Replying to myself in case anyone has the same question in the future and is searching for an answer.
I couldn't find any direct support for embedding WAV files in a Flex Builder 3 / ActionScript 3 application. What I did try and was delighted to see it works is to create a Flash Movie in Flash CS 3 (you will need to own that or get an evaluation) and import your sounds to the library and link them to be exported by ActionScript. Export the Flash CS3 project to a SWF movie and save it in your project (I added it to a "lib folder").
Your ActionScript code to create and play the sound should be:
private static var BigShipSound: Class;
var bigShipSound : Sound = BigShipSound as Sound;
There's a library you can use
The Flash player doesn't know how to directly play wav files. It's true that you can import them to the authoring tool, but when you publish the SWF your audio will be converted to mp3 or adpcm or whatever you select in your publish settings. Even if you read in a wav at runtime, the only way to play it is by parsing the binary stream, so naturally the same limitation applies if you embed the file.
Some related info at this question. Which curiously you seem to have commented on last year! :)