MP3 processing question

Q

Questman

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
 
S

Snyke

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
 
O

Oliver Wong

Questman said:
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.

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
 
M

Monique Y. Mudama

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).
 
L

Luc The Perverse

Monique Y. Mudama said:
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).

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top