Hello everyone,
Does anyone know an approach I could take to look at MP3 files in a
directory and :
a) determine the song length (e.g. 3 minutes 47 seconds)
b) "crop" the song (for example, take from 1 minute 00 seconds through 2
minutes, 00 seconds and discard the rest)
c) downconvert the bitrate (from 320k, say, to 64k)?
I'm working on a project that aims to automate creation of "preview"
snippets and I'd love to use Java for it.
Thanks!
Rick
Snyke - 19 Jan 2006 21:11 GMT
Well once stripped the id3 tags the data after that is just divided
into blocks. I seem to remember that if you have a 128 kbps song you
can take the length of the file in bits and simply divide it by
128*1024 and you'll get the length in seconds.
MP3 files are pretty tollerant about cutting, just try to get a full
block size and then everything should play fine. As for the
downsampling I don't know any good library, maybe you can find the
bindings for the LAME library somewhere out there ;-)
Greets,
Snyke
Monique Y. Mudama - 19 Jan 2006 23:48 GMT
> Well once stripped the id3 tags the data after that is just divided
> into blocks. I seem to remember that if you have a 128 kbps song you
> can take the length of the file in bits and simply divide it by
> 128*1024 and you'll get the length in seconds.
Unless of course you have a variable bit rate MP3 .... (I avoid them;
VBR did horrible things to a sample song I tried, and now I'm scared
of it).

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Luc The Perverse - 20 Jan 2006 02:28 GMT
>> Well once stripped the id3 tags the data after that is just divided
>> into blocks. I seem to remember that if you have a 128 kbps song you
[quoted text clipped - 4 lines]
> VBR did horrible things to a sample song I tried, and now I'm scared
> of it).
VBR works quite well with the latest LAME codec.
However I'm currently in the process of comparing side by side high quality
Vorbis, MP3 and Lossless audio and am astounded by the difference.
I'm thinking of switching to a lossless codec for all my music. I use FLAC
--
LTP
:)
Oliver Wong - 19 Jan 2006 21:14 GMT
> Hello everyone,
>
[quoted text clipped - 8 lines]
> I'm working on a project that aims to automate creation of "preview"
> snippets and I'd love to use Java for it.
You can either find a library for manipulating mp3 files, or try to
parse the information yourself. To do the former, do a google search for
"java mp3". To do the latter, do a google search for "mp3 format".
- Oliver