Skip to main content
Participant
November 29, 2011
Question

Removing noise wheh mic attached to Stream on Media server

  • November 29, 2011
  • 1 reply
  • 1221 views

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;
}

    This topic has been closed for replies.

    1 reply

    December 6, 2011

    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。

    Nikhil_Kalyan
    Participating Frequently
    December 13, 2011

    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 !