hussein
hussein

Reputation: 67

Sound editing in flash

Is there any way to make a flash sound editing application with Action Script ? I'm pretty sure that there is no way around that but i want to make sure . also if not then as a relevant can i use flex to do that . if not then i have to ask what to use to do that . I'm planning to publish that over the web . thanks in advance . and forgive my ignorance

Upvotes: 0

Views: 335

Answers (1)

chif
chif

Reputation: 111

Yes, you can! Use flash.media.Sound.extract to get raw data and modify it however you want. Small example from docs:

    function processSound(event:SampleDataEvent):void
    {
    var bytes:ByteArray = new ByteArray();
    sourceSnd.extract(bytes, 4096);
    event.data.writeBytes(upOctave(bytes));
    }
    function upOctave(bytes:ByteArray):ByteArray
    {
         var returnBytes:ByteArray = new ByteArray();
        bytes.position = 0;
        while(bytes.bytesAvailable > 0)
        {
            returnBytes.writeFloat(bytes.readFloat());
            returnBytes.writeFloat(bytes.readFloat());
            if (bytes.bytesAvailable > 0)
            {
                bytes.position += 8;
            }
        }
        return returnBytes;
    }

Also you may want to use flash.media.SoundTransform if you want some simple transformations.

Upvotes: 4

Related Questions