I’m trying to rig up a basic mp3 cutter in Flash (using the Flex framework)
I have gotten so far:
var ba:ByteArray=new ByteArray();
sound.extract(ba, playEnd - playStart, playStart);
This extracts the relevant bytes from the sound object and stores them in ba
Then, I do this:
saveFile=new FileReference();
saveFile.save(ba, sound.id3.artist + " - " + sound.id3.songName + ".mp3");
The file saves properly, but it can not be played (Players say it is corrupted)
Any pointers as to how I can create a valid mp3 file from the byteArray obtained after the extraction?
Thanks,
Pranav
I have written many articles on audio processing with Flash on my blog. Here is one that you might find helpful:
http://labs.makemachine.net/2010/07/slice-tool-looper/
This article outlines how to use the microphone to record audio and also includes some info on saving audio files:
http://labs.makemachine.net/2011/04/record-visualize-save-microphone-input/