mp3 hassle - automatically setting buffer size from import!
Hi all,
Ive been making a pretty good mp3 player by using buffer~, info~ and play~.
Ive noticed an issue with import and read. Firstly the read function must be used before an import otherwise the buffer will not load the audio. Once read had been used with a .wav file I can then import a mp3 into the buffer. The buffer will then automatically adjust to the correct length for the mp3. If I then use a read function with wav after the buffer will remain at the length of the mp3 previously loaded. This only happens when switching from wav to mp3 and back again.
Does any one know how to get round this, without having to manually enter the info, thanks in advance.
Ahhhhhhhhhhhh! MP3 sucks.
ahhh sod it!
some one please make it betterr. LOL
thanks!
Use "replace" instead of "read" to automatically resize the buffer to the length of the audio file. If you look at the [buffer~] reference page it will explain all the different messages you can send to the object.
lh
Please take a look at the buffer~ entry in the manual, check the message description for read and import.
While the help patches are a good start, you should always refer to the manual for detailed behaviour if things does not work out as you expected.
Simultaneous post .
High five!
lh
I only noticed that command after posting. And yes it does work perfectly thanks very much. Will look closer next time.
Whilst u are all here on the subject. I intend to try and make a audio list slash library. How would I approach trying to detect a format of file, so I could somehow automatically use replace or import depending on format.
Also can I get the length of file without adding to a buffer then using info~?
Am I using the best method for mp3 functionality also. Is grove better? Or maybe spigot~ via the quicktime stuff? Any opinions are welcome.
Just wanna consider the best options really.
Thanks peps.
RabidRaja, thanks very much. Just what I needed. I have been using some over complicated ways to achieve what u did with a few objects!
Thanks very much.
Here's a method that uses [regexp] to check to see if the filename ends in ".mp3" if it does then it is formatted for the "import" message and if not for the "replace" message.
lh
Keep em coming, some great techniques. Thanks!
hi,
Is there a way to filter only .mp3 files?
Thanks
Luis Marques
The example I posted above will show only .mp3 files from the middle outlet.
lh
hi,
yes, that does do that. but in objects like "folder" or "umenu"?
Thanks
Luis Marques
Look at the help file and you will notice you need the filetype message. These can be found in cycling '74 > init > max-fileformats.txt or for individual files by looking at the right outlet of [dropfile].
lh
i've already done that... and nothing appears in the right outlet from dropfile object when i drop an mp3 file, and there is no mp3 code in max-fileformats.txt. I hope there's a new way to do that...
thanks
Luis Marques
I just tried a few.p3 files and got "MP3 " and "MPG3" as the results, perhaps give those a try.
lh
OK.
i will.
Thanks
Luis Marques
hi,
i tried those mp3 codes, but only work whit some of them, not all.
I dropped my iTunes Library to object folder, and have luck on a few albums...
Thanks for your time,
Luis Marques
Did you try the sfinfo~ object? Not sure if it works for compressed files.
Dam! That is rubbish. Same problem here too.
This is particularly disappointing!