Question

In my application, I use the microphone to record and get the result in ByteArray, then, I convert it in playable Sound by using the WavSound class from org.as3wavsound.

Record and play work correctly except a huge lag at the launching of the sound ( Easily 2 secondes ).

My code is something like this :

import org.as3wavsound.WavSound;
import org.bytearray.micrecorder.encoder.WaveEncoder;
import org.bytearray.micrecorder.MicRecorder;

/* ... */

var wavEncoder:WaveEncoder = new WaveEncoder( 0.5 );
var recorder:MicRecorder = new MicRecorder( wavEncoder );
recorder.record();

/* ... */

recorder.stop();
var sound:WavSound = new WavSound( recorder.output );

/* ... */

sound.play();

Thanks a lot to help me understand what's wrong in it.

Was it helpful?

Solution

Looks like this is a known issue with the as3wavsound library: Delay When Playing Sound using as3wavsound

The answer on that post tells you to decrease the MAX_BUFFERSIZE in WavSoundPlayer to 2048.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top