Reputation: 19
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.
Upvotes: 0
Views: 113
Reputation: 3728
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.
Upvotes: 1