Thursday, August 1, 2013

Flash acoustic echo cancellation

Acoustic echo cancellation (AEC) is required for voice-over-IP (VoIP) applications to provide headset-free talk. AEC is available in messenger applications (such as Skype and Google Talk) and softphones (such as Xlite).

In Flash, to use acoustic echo cancellation, call the Microphone.getEnhancedMicrophone() method to get a reference to a Microphone instance. Set Microphone.enhancedOptions to an instance of the MicrophoneEnhancedOptions class to configure settings. When AEC is not supported, Microphone.getEnhancedMicrophone() returns null.

Here are sample codes:
var mic:Microphone = Microphone.getEnhancedMicrophone();
var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
options.echoPath = 128;
options.nonLinearProcessing = true;
mic.enhancedOptions = options;
There are two other settings similar but not exactly for acoustic echo cancellation.
  1. setUseEchoSuppression - this method can reduce, but not eliminate, the risk of feedback amplification. When enhanced audio is used, this echo suppression functionality is ignored.
  2. noiseSuppressionLevel - Maximum attenuation of the noise in dB (negative number) used for Speex encoder. If enabled, noise suppression is applied to sound captured from Microphone before Speex compression. Set to 0 to disable noise suppression. Noise suppression is enabled by default with maximum attenuation of -30 dB. Ignored when Nellymoser codec is selected.
References:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/package-detail.html
http://www.adobe.com/devnet/flashplayer/articles/acoustic-echo-cancellation.html

No comments:

Post a Comment