Sunday, March 27, 2011

How to use the SPEEX codec in video streaming for better audio encoding

Speex has a better audio sound encoding then Nellymoser.

we can use this only in above flex 4 sdk and flash Player 10 or above.

var mic: Microphone= Microphone.getMicrophone();

mic.codec = SoundCodec.SPEEX;

Flash Player 10.3 - Acoustic Echo Cancellation

Acoustic Echo Cancellation – Flash Player 10.3 enables developers to create real-time online collaboration experiences with high-quality audio, such as telephony, in-game voice chat, and group conferencing applications. Developers can take advantage of acoustic echo cancellation, noise suppression, voice activity detection, and automatic compensation for various microphone input levels.

Sample Code for Using AEC
var enhancedMicrophone:Microphone = Microphone.getEnhancedMicrophone();
var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
options.autoGain = false;
options.echoPath = 128;
options.nonLinearProcessing = true;
enhancedMicrophone.enhancedOptions = options;

To use the new Flash Player 10.3 features, you will need to target SWF version 12 by passing in an extra compiler argument to the Flex compiler: -swf-version=12.