raphael seguin wrote:
> Hi maxers,
> I’d like to deal with mp3 in MSP but i’m having several problems :
> 1) The import function of the [buffer~] is very slow ( it takes something
> like 1 minute to import a tiny 3 minutes track) and it’s freezing the
> 2) It doesn’t resize the [buffer~] automatically (as the replace function)
> so i can’t get the real track length, which is critical.
> Does anyone have a solution, suggestion, enlightment ?
This one might help:
To have it resize the buffer use the ‘replace’ method for importing the
mp3. I don’t have any comparisons regarding decompression speed, but at
least it doesn’t block Max.
A ususal this is beta and might crash (especially the possible arguments
are untested). The error mesages you will get are normal and due to the
fact that the decoder tries to decode ID3 tags and whatever non-mp3 data
there is in your file. Usually this won’t hurt.
In addition decoding mp3 might be illegal where you are (at least
without paying a license fee)… so be warned.
If you set the buffer size to zero first, it will automatically resize on import. I had to use import, because i wanted the audio stream of a movie.
#P window linecount 1;
#P newex 122 529 120 196620 t s b;
#P message 232 561 46 196620 size 0;
#P newex 122 558 102 196620 prepend import;
#P newex 122 586 131 196620 buffer~ mp3sample;
#P connect 3 1 2 0;
#P connect 2 0 0 0;
#P connect 1 0 0 0;
#P connect 3 0 1 0;
Have another look at help file of buffer~. You can append arguments to the import message to avoid setting the bufffer size to 0 first. I use