I'm having trouble recording streaming audio from a Flex 3 app to Flash Media Server. Via other programs, I'm able to record audio successfully, so I ruled out the microphone itself as a culprit.
In my code, once the user clicks on the 'record' button, the following code gets executed (it's in a method in an AudioManager object).
The _audioStream is a custom AudioStream that extends the NetStream class.
Code:
public function recordAudio(filename:String):void {
this._audioStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
this._audioStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
this._audioStream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
this._audioStream.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
this._isPublishing = true;
this._isPlaying = true;
//this._audioStream.recordAudio(filename);
var mic:Microphone = Microphone.getMicrophone();
trace("Microphone: " + mic);
mic.rate = 22;
mic.setSilenceLevel(1);
mic.gain = 100;
this._audioStream.attachAudio(mic);
this._audioStream.publish(filename, "record");
}
I'm also setting appropriate event handlers (onNetStatus, etc). According to the NetStatusEvents, I'm successfully getting a stream, but when I speak into the microphone, the stream doesn't get any data.
Console output:
Start recording
NetStream.Publish.Start
NetStream.Record.Start
NetStream.Buffer.Empty
NetStream.Buffer.Empty
NetStream.Buffer.Empty
Stop recording
NetStream.Record.Stop
NetStream.Unpublish.Success
I'm really stuck - I can't think of any logical reason why the NetStream would silently fail to get data from the microphone

Can anyone see something I missed?