Flash / Flex Speex audio decodes to play speex file

I want to play * .spx files that are Speex encoded on the Internet.
But I do not know Flash / Flex or any Flash Audio codec. After a Google search for the whole day, I got some solutions, that is:

I think the best solution is Spx decoding in AS3, yes, I would like to make Flash Player Flash.

, Speex Library speex.org, Adobe Alchemy. ./configure;make libspeex, libspeex/speex.c libspeex.swc Alchemy. , . speex AS3?
libspeex.swc: http://demo.0x123.com/libspeex.swc

libspeex API Alchemy libspeex.swc?

AS, . , .

+5
2

Adobe , Alchemy, ( ). , , speex.

Xuggle tricked-out ffmpeg (http://code.google.com/p/xuggle-ffmpeg/) speex FLV? xuggle " ", , , FLV, speex, netStream.play.

ffmpeg -i test.wav -acodec libspeex -f flv -y speex.flv

-.

+1

, speex API :
http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Developing_with_Alchemy:C_API
http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Developing_with_Alchemy:AS3_API

helloWorld. , .:)

< > main.c

#include <stdio.h>
#include "AS3.h"

static AS3_Val addNumber(void* self, AS3_Val args)
{
        double num1 = 0.0;
        double num2 = 0.0;

        AS3_ArrayValue( args, "DoubleType, DoubleType",
                       &num1, &num2);

        double sum = num1 + num2;
        return AS3_Number(sum);
}

static AS3_Val helloString(void* self, AS3_Val args)
{
        char *str = "Hello, Alchemy!";
        return AS3_String(str);
}


int main ()
{

        // define the methods exposed to ActionScript
    // typed as an ActionScript Function instance
    AS3_Val addNumberMethod = AS3_Function(NULL, addNumber);
        AS3_Val helloStringMethod = AS3_Function(NULL, helloString);

    // construct an object that holds references to the functions
    AS3_Val result = AS3_Object("addNumber: AS3ValType, helloString: AS3ValType",
                                    addNumberMethod,
                                    helloStringMethod);

    // Release
    AS3_Release(addNumberMethod);
        AS3_Release(helloStringMethod);

    // notify that we initialized -- THIS DOES NOT RETURN!
    AS3_LibInit(result);

    // should never get here!
    return 0;

}


$ main.c -O3 -Wall -swc -o HelloAlchemy.swc

AS:

        import cmodule.HelloAlchemy.CLibInit;
        import mx.controls.Alert;

        private var loader:CLibInit;
        private var lib:Object;

        private function init():void
        {
            loader = new CLibInit;
            lib = loader.init();
        }
        protected function button1_clickHandler(event:MouseEvent):void
        {
            Alert.show(String(lib.addNumber(Number(3),Number(5)))); 
        }

        protected function helloStringButton_ClickHandler(event:MouseEvent):void
        {
            var str:String = String(lib.helloString());
            Alert.show(str);
        }
0

All Articles