So i recently discovered that flash 11 has an option to use raw float data with the sound API.
Awesome.
But it's pretty glitchy.
I wrote up a simple program to demonstrate what i mean.
Here's a link:
http://pastebin.com/8n6Y8SYn
What this does is simply write a sine wave to a byte array at 440 hertz ( A natural,
Assuming the sample rate is 44100 samples per second )
then uses the loadPCMFromBytearray method on the sound object and plays it.
It works just fine for a few moments, but then it glitches and starts making an awful clicking.
( I think it may also be breaking something, as the sound never stops )
I'm not sure if this is just an issue with flash that needs to be sorted, or if i'm doing something very wrong. Either way, I'd love some input as to whether it works for you.
I've also drawn out the waveform near the end of the byte array, along with the data extracted from the sound object. It doesn't seem to be corrupted. :/
Thanks.