# Speex with actionscript 3

**URL:** <https://forum.kirupa.com/t/speex-with-actionscript-3/281699>\
**Category:** Uncategorized\
**Created:** [February 12, 2009, 9:26am UTC](https://forum.kirupa.com/t/speex-with-actionscript-3/281699 "2009-02-12T09:26:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![codetheworld](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@codetheworld](https://forum.kirupa.com/u/codetheworld)\
**Post date:** [February 12, 2009, 9:26am UTC](https://forum.kirupa.com/t/speex-with-actionscript-3/281699/1 "2009-02-12T09:26:06Z")

</div>

i have captured PCM data from my Audio input (using a Windows C Program )& dumped the captured data into a file. then i used speex encoder to encode that file & created a final encoded file.  
i want to used this encoded file in flash & output the captured sound. flash 10 says that it has inbuilt support for speex, however i’m not able to find any function which can decode my data & play the sound.

I tried using flash.media.Sound, SampleDataEvent.SAMPLE\_DATA i.e generating sound dynamically. however i’m not able to fill the event.data member with the required data( samples ).

My Audio capture uses the following configuration for recording

Format : WAVE\_FORMAT\_PCM  
Samples per sec : 8000  
Bits per sample : 16 ( 2bytes )

for encoding using speex my frameSize is 320

Please provide me with any sample actionscripts to decode the speex encoded data & generated sound data dynamically.

Also the following link

[http://help.adobe.com/en\_US/ActionSc…F1A087ED7.html](http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WSE523B839-C626-4983-B9C0-07CF1A087ED7.html)

says that maximum of 8192 should be used. Does this mean my samples per second cannot be more than that for my C program. In that case how do i achieve better quality of sound?
