Speex Codec

 Speex is a new voice codec supported in Flash Player 10 and above. With the new release of flash player 10 this document explains a little about the new codec with this release.

Setting Up Flex SDk / Flex Builder

Flex SDK / Flex Builder needs to be setup to target flash player 10 playerglobal.swc which has the new features enabled.

Taken from the Adobe Open Source area

Get Flex 3 SDK

  • Download Flex SDK 3.0.3 or above. In Flex 3 extract into the sdks directory.
  • Make sure that you have a Flash 10 playerglobal.swc at FLEX_SDK/frameworks/libs/player/10/playerglobal.swc.

Config Flex Config To Target Flash Player 10

  • Modify FLEX_SDK/frameworks/flex-config.xml. Edit <target-player>, replacing 9.0.115 with 10.0.0:
  • In <external-library-path>, edit the path-element for playerglobal.swc, replacing 9 with 10:
  • Do the same with <library-path:
  • In flex builder, right click the project and choose properties, choose Flex Compiler, choose the "Configure Flex SDKs" link on the right, choose add then choose the location of the newly downloaded SDK and give it a name.
  • Back in the Flex Compiler config choose "Use a specific SDK and select in the list the Flex SDK configured previously.

Code Example

Setup the Microphone class to use the new Speex Codec.

_microphone = Microphone.getMicrophone();
if (_microphone) {
    _microphone.codec = SoundCodec.SPEEX;
    _microphone.encodeQuality = 10;
    _microphone.rate = 44;
    _microphone.framesPerPacket = 2;
    _microphone.gain = 50;
} else {
    throw new Error("Audio Not Connected");

FFMpeg and Speex

According to Art Clarke subversion revision  r15028 of the FFMpeg source code has the capabilities of decoding the Speex codec from FLV files.