Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
Have you done the problem?can you send some data for this to me?33845916@qq.com
I have the same problem, it is very bad quality。
Copy link to clipboard
Copied
Hi,
You can try the following :
Codec can be set to Speex, I guess that's a better option.
mic.echopath = 128
mic.NoiseSuppresion = true
mic.speakerGain = 100 / autogain = false (please check the documentation for the correct method).
mic.setQuality = best
mic.framesPerPacket = 1;
mic.setSilenceLevel(0, mic.silenceTimeout)
mic.automode = false
Let us know if they are useful. Thank you !