Removing noise wheh mic attached to Stream on Media server
I am using these settings for media server but there's too much noise when a mic is attached to stream. Code is as following, can you suggest changes to remove the noise for more crystal clear voice?
public function initMicrophone():void
{
mic = getMicrophone();
if (mic == null)
{
trace("No available microphone");
}
else
{
mic.setLoopBack(false);
mic.setSilenceLevel(10, 20000);
mic.gain = 60;
mic.addEventListener(ActivityEvent.ACTIVITY, micActivityHandler);
mic.addEventListener(StatusEvent.STATUS, micStatusHandler);
mic.codec = SoundCodec.PCMU;
//mic.codec = "Speex";
//mic.encodeQuality = 10;
//mic.framesPerPacket = 2;
}
}
private function getMicrophone():Microphone
{
var mic:Microphone = Microphone.getEnhancedMicrophone();
var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
options.nonLinearProcessing = true;
mic.enhancedOptions = options;
return mic;
}
