Kaptnkill
Kaptnkill

Reputation: 185

Recording sound with actionscript3 without waiting for mic activity to begin writing the bytearray

I am testing sound recording in as3 and now i have this question :

I am using this line to start the recording and write sound data to the bytearray (wich works) :

_mic.addEventListener(SampleDataEvent.SAMPLE_DATA, getMicAudio);

But the thing is that the sound only start to get written when there is some activity on the mic...

For example, let say i use a "rec" button and click it, i want the bytearray to be filled as soon as the button is clicked...not waiting for mic activity...

So, is it possible to fill a bytearray with "no sound" and how would that be done?

Thanks for any help you can bring!

Upvotes: 1

Views: 1193

Answers (1)

user562566
user562566

Reputation:

Just adjust the microphone settings so that there is ALWAYS activity on it as long as you're running it. You do this by adjusting settings like microphone.silenceLevel:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Microphone.html#setSilenceLevel()

So for example, you set the silence level to 0 and the timeout to 99999 or something. This way flash will no longer automatically shut off the microphone when there is no or low sound.

Upvotes: 1

Related Questions