11/20/2010 9:23:55 AM
Title:
Playing back sound recorded at 16khz
I'm using the Speex codex of flash to record sound, and it records it at 16 khz (no way to change that). Is there a way I can playback the sound using the sound object so it doesn't lost pitch? Right now I am doing this:
private function playRecorded(e:SampleDataEvent): void
{
if (!rec.bytesAvailable > 0)
return;
var length:int = 2730;
for (var i:int = 0; i < length; i++)
{
var sample:Number = 0;
if (rec.bytesAvailable > 0) sample = rec.readFloat();
e.data.writeFloat(sample);
e.data.writeFloat(sample);
e.data.writeFloat(sample);
e.data.writeFloat(sample);
e.data.writeFloat(sample);
e.data.writeFloat(sample);
}
}
But this makes the sound a little lower than it started at.