Based on the resource here (determining the structure of the WAV file ), I was able to get audio data between the 44th byte and near the end of the file (at the end there are some additional metadata that are not needed).
But I canβt load it using the new Sound.loadPCMFromByteArray() method available in Flash Player 11.
I get this error if I pass the number of samples:
_sound.loadPCMFromByteArray(pcm, pcm.length, "float", wav.isStereo, wav.sampleRate);
- Exclude error [Fault], information = ArgumentError: Error # 2084: AMF encoding of arguments cannot exceed 40K
However, if I divide pcm.length into four (4), it seems to play βsomething,β but not at all the pattern that I originally passed. Also, it sounds like a cycle forever, is this intended behavior? (I hope not!)
//Dividing by 4 (
Is it necessary to process ByteArray data from WAV in a certain way to match the readable PCM format? Do I need to insert an EOF symbol at the end so that it knows when to stop the sound file?
Should I use a different format than "float"? Which of them are supported?
source share