italiano40
italiano40

Reputation: 496

How can I override the default microphone in Flex?

I am making a webcam broadcasting application in Flex 4 and I can switch the cameras programmatically letting the user inside my application choose which camera, but when the user tries to select the microphone, it is always the default microphone that is the security settings that is always being broadcasted.

How can I override that setting like the webcam can do?

            private function selectmic(event:DropDownEvent):void {
            var index:int=micdropDownList.selectedIndex;
            microphone = Microphone.getEnhancedMicrophone(index);
            microphone.codec=SoundCodec.SPEEX;
            microphone.encodeQuality=5;
            microphone.setSilenceLevel(0);
            microphone.framesPerPacket = 1;
            microphone.gain = 75;
            microphone.rate = 44;
        }

And I am attaching it to the stream using

pubStream.attachAudio(microphone);

Upvotes: 0

Views: 64

Answers (1)

Sai Ram
Sai Ram

Reputation: 255

Not Best But better Setting for Microphone...

 microphone = Microphone.getEnhancedMicrophone();
//microphone.codec =SoundCodec.NELLYMOSER;  //for recording
microphone.codec =SoundCodec.SPEEX;    //for live
microphone.enableVAD = true;
microphone.setLoopBack(false);
microphone.setUseEchoSuppression(true);
microphone.setSilenceLevel(0,2000);
microphone.rate = 44;
microphone.gain = 1;
microphone.encodeQuality = 7;
microphone.framesPerPacket = 1;

Add some more setting if anyone one have, to make it best setting.. _/_

Upvotes: 1

Related Questions