1

I tried to extract raw data from loaded mp3 file. And suddenly, sound.extract method returned less data then Math.floor( sound.length * 44.1 ).

sound = new Sound();
sound.loadCompressedDataFromByteArray( data, data.length );
_output = new ByteArray();
var len : Number = sound.extract( _output, Math.floor( sound.length * 44.1 ) );

For example:

Math.floor( sound.length * 44.1 ) = 213120, but len = 211968 :(

I tried many mp3 files and sound.extract always return less data then expected.

I also tried load data use sound.load() function and in this case, sound.extract returned exactly Math.floor( sound.length * 44.1 ) as expected.

Math.floor( sound.length * 44.1 ) = 213120 and len = 213120 :)

Direct download using sound.load function doesnt fit me very well, because i analyze mp3 LAME frame for encoderDelay and encoderPadding. For play mp3 without gap.

Does anybody know is it loadCompressedDataFromByteArray Adobe bug or i did something wrong?

Tenuj
  • 11
  • 1
  • loadCompressedDataFromByteArray gets mp3 file on input. This function also analyzes ID3 tags and dispatches id3 event. If this function analyzes only plain mpeg frames, sound.length will be more then expected and Math.floor( sound.length * 44.1 ) will be also more. WVXVW - i think your assumption not correct :( – Tenuj Dec 10 '12 at 13:38

0 Answers0