Hi Joonsoo Kim, We tried with a sample application made using the code snippet you provided to us. Yes, we do observe the echo occurring in loopback scenario but it works completely fine if we include the same mic settings in a sample application that establish a VOIP connection between two iPhone devices. Could you please try it with an application where two devices are interacting with each other. Please refer to the below code snippet : package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.AsyncErrorEvent; import flash.events.NetStatusEvent; import flash.events.TimerEvent; import flash.media.Microphone; import flash.media.MicrophoneEnhancedOptions; import flash.net.NetConnection; import flash.net.NetStream; import flash.utils.Timer; public class EchoCancel_RTMPTestWorking extends Sprite { public var ns:NetStream; public var nc:NetConnection; public var mic:Microphone; public var ns2:NetStream; public var nc2:NetConnection; public var delay:Number = 10000; private var PUBLISH_STREAM_NAME:String = ""; private var PLAY_STREAM_NAME:String = ""; private var USER_NAME:String = ""; // Define before compilation who we are first phone or second phone. set "firstPhone:Boolean = false" when launching the code on second phone. private var firstPhone:Boolean = true; public function EchoCancel_RTMPTestWorking() { super(); // support autoOrients stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; if (firstPhone) { PUBLISH_STREAM_NAME = "streamOne"; PLAY_STREAM_NAME = "streamTwo"; USER_NAME = "userOne"; }else { PUBLISH_STREAM_NAME = "streamTwo"; PLAY_STREAM_NAME = "streamOne"; USER_NAME = "userTwo"; } test(); } public function test():void { nc= new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR , onAsyncErrorEventHandler); var clientObj:Object = new Object(); nc.client = clientObj; trace("even listner called"); nc.connect("rtmp://IPADDRESS/live",USER_NAME); trace("connection success"); } /** * ON ASYNC ERROR * @param e */ private function onAsyncErrorEventHandler(e:AsyncErrorEvent):void { trace("e"+e); } /** * ON NET STATUS * @param event */ private function netStatusHandler(event:NetStatusEvent):void { trace(event.info.code + " | " + event.info.description); switch (event.info.code) { case "NetConnection.Connect.Success": trace("Connection Sucseed Publish My and Play Others stream"); //PUBLISH MY STREAM ns = new NetStream(nc); ns.publish(PUBLISH_STREAM_NAME,"live"); enableMic(); // PLAY OTHER STREAM ns2 = new NetStream(nc); ns2.play(PLAY_STREAM_NAME, -1); break; case "NetStream.Publish.Start": break; } } public function enableMic():void { //ns.attachAudio(null); mic= Microphone.getEnhancedMicrophone(); var option:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions(); //option.mode = MicrophoneEnhancedMode.FULL_DUPLEX; option.autoGain = false; option.echoPath = 128; option.nonLinearProcessing = true; mic.enhancedOptions = option; mic.noiseSuppressionLevel = -30; mic.codec = "speex"; mic.encodeQuality = 5; mic.framesPerPacket = 1; mic.setUseEchoSuppression(true); mic.rate = 48; mic.gain = 50; mic.setSilenceLevel(0,200); ns.attachAudio(mic); } } } Thanks, Adobe AIR Team
... View more