Question

I'm looking for a flash widget that allows users to record their audio and then send it to the server.

There are a few similar questions:

Record Audio and Upload as Wav or MP3 to server

They advocate using Red5 or flash media server.

Shouldn't it be possible to record locally on the user's client using the codecs that the user already has and then upload the resulting file to the server, rather than say, process the and record the stream on the server itself.

Thanks.

Was it helpful?

Solution

According to the the Capturing Sound Input Article if you are running Flash Player 10.1 you can save the microphone data to a ByteArray. The Capturing microphone sound data section gives the following example on how to do it:

var mic:Microphone = Microphone.getMicrophone(); 
mic.setSilenceLevel(0, DELAY_LENGTH); 
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler); 

function micSampleDataHandler(event:SampleDataEvent):void { 
  while(event.data.bytesAvailable) { 
    var sample:Number = event.data.readFloat(); 
    soundBytes.writeFloat(sample); 
  } 
}

Once you have the ByteArray you can of course do whatever you want with it.

OTHER TIPS

Once you have the ByteArray you can pass it in with NetStream.appendBytes()

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