Actually, looking at a post from this developer, it looks like the
.bytesAvailable > x is the main target to determine the amount of sound.
https://forums.adobe.com/thread/1096313
//if audio bytes is greate than 4 read the recorded byte array data and write
it into the sound
for (var i=0; i<8192; i++)
{
if (soundBytes.bytesAvailable > 4)
{
var sample:Number = soundBytes.readFloat();
e.data.writeFloat(sample);
e.data.writeFloat(sample);
}
}
On Tuesday, March 22, 2016 5:22 PM, Matthew Weir
<[email protected]> wrote:
I don't have a mic on me, so I can't test it. However this might be in the
area you are looking for:
microphone.addEventListener(SampleDataEvent.SAMPLE_DATA, onSampleData);
private function onSampleData(event:SampleDataEvent):void {
while(event.data.bytesAvailable > 0)
_buffer.writeFloat(event.data.readFloat()); }
taken from: https://code.google.com/archive/p/micrecorder/downloads
On Tuesday, March 22, 2016 5:09 PM, scott matheson <[email protected]>
wrote:
Hi
I record my student voices and i wan to check the Mic is actually “work” buy
checking for data in the recording stream, any one got some code they could
share
Thanks
Scott