Search code examples
apache-flexaudioflashmicrophonespeex

How to play speex encoded audio in Flash player?


I am able to record sound from microphone, encode it using SPEEX and write into ByteArray. I want to play it back. If I try using Sound object the audio is messed up. Speex uses 16kHz for encoding and Sound Object needs 44.1kHz for playing audio. How am I supposed to play this encoded sound.

Please help!!

- Pat


Solution

  • Is this a browser or Air based application?

    The reason I ask is because Speex is only playable through an FLV container. It's a one way encode that is made to be streamed through a media player like FMS or Wowza. Here's what you need to do for both cases.

    If browser based There's no way to playing it locally. You're going to have to stream it to a media server which then returns an FLV file for you to play on the client.

    If Air based You can wrap the speex audio into an FLV container and play it locally. Use this library to write the FLV locally: http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/