Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > MP3 processing question

Reply
Thread Tools

MP3 processing question

 
 
Questman
Guest
Posts: n/a
 
      01-19-2006
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

 
Reply With Quote
 
 
 
 
Snyke
Guest
Posts: n/a
 
      01-19-2006
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

 
Reply With Quote
 
 
 
 
Oliver Wong
Guest
Posts: n/a
 
      01-19-2006

"Questman" <(E-Mail Removed)> wrote in message
news:IZRzf.43878$(E-Mail Removed)...
> 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


 
Reply With Quote
 
Monique Y. Mudama
Guest
Posts: n/a
 
      01-19-2006
On 2006-01-19, Snyke penned:
> 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).

--
monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
 
Reply With Quote
 
Luc The Perverse
Guest
Posts: n/a
 
      01-20-2006
"Monique Y. Mudama" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 2006-01-19, Snyke penned:
>> 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).


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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3GP to MP3 Convert 3GP to MP3 using 3GP MP3 Converter music-fan DVD Video 0 12-24-2009 04:58 AM
MP3 playback using Java Sound and Sun MP3 plugin Daniel Dyer Java 6 01-22-2006 05:43 PM
Question: processing HTML, re-write default processing action of many tags Hubert Hung-Hsien Chang Python 2 09-17-2004 03:10 PM
New Forum site about mp3 and mp3 related topics Steve Steele Computer Support 1 04-14-2004 10:21 PM
wav to mp3 convertor and mp3 encoder request hugh jass Computer Support 2 12-03-2003 02:37 AM



Advertisments