Implementing Acoustic Echo Cancellation/Suppression in Flash/Flex applications
The new Flash Player 10.3 (yet to be released) has a native Acoustic Echo Cancellation/Suppression algorithm as a feature. Implementation tests within a Flash Audio Video chat system have shown impressive results. In order to implement this though you will need to have the flashplayerglobal for the 10.3 player and update your Flex SDK to 4.5. You will also need to add to the ‘Additional compiler arguments’ input: -swf-version=12. You must have the 10.3 beta player installed - obviously. This is the code I used to test it.
private function getMicrophone() : Microphone {
var m : Microphone;
Logger.info('player version:: ' + Capabilities.version);
if(Capabilities.version.search('10,3') == -1)
{
Logger.warn('Enhanced Mic unavailable');
m = Microphone(Microphone.getMicrophone());
}else{
Logger.warn('Enhanced Mic available');
m = Microphone(Microphone['getEnhancedMicrophone']());
var options : MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
options.autoGain = false;
options.echoPath = 128;
options.nonLinearProcessing = true;
m['enhancedOptions'] = options;
}
m.gain = 75;
// set codec to speex
m.codec = "Speex";
m.encodeQuality = 5;
m.setUseEchoSuppression(true);
return m;
}
Enjoy echoless chats :)

private function getMicrophone() : Microphone {
var m : Microphone;
Logger.info('player version:: ' + Capabilities.version);
if(Capabilities.version.search('10,3') == -1)
{
Logger.warn('Enhanced Mic unavailable');
m = Microphone(Microphone.getMicrophone());
}else{
Logger.warn('Enhanced Mic available');
m = Microphone(Microphone['getEnhancedMicrophone']());
var options : MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
options.autoGain = false;
options.echoPath = 128;
options.nonLinearProcessing = true;
m['enhancedOptions'] = options;
}
m.gain = 75;
// set codec to speex
m.codec = "Speex";
m.encodeQuality = 5;
m.setUseEchoSuppression(true);
return m;
}
Enjoy echoless chats :)
