MP3 processing question

Discussion in 'Java' started by Questman, Jan 19, 2006.

  1. Questman

    Questman Guest

    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
    Questman, Jan 19, 2006
    #1
    1. Advertising

  2. Questman

    Snyke Guest

    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
    Snyke, Jan 19, 2006
    #2
    1. Advertising

  3. Questman

    Oliver Wong Guest

    "Questman" <> wrote in message
    news:IZRzf.43878$...
    > 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
    Oliver Wong, Jan 19, 2006
    #3
  4. 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
    Monique Y. Mudama, Jan 19, 2006
    #4
  5. "Monique Y. Mudama" <> wrote in message
    news:...
    > 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

    :)
    Luc The Perverse, Jan 20, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Dyer
    Replies:
    6
    Views:
    19,891
    Knute Johnson
    Jan 22, 2006
  2. Asle Frantzen

    Mp3-player - how to play an mp3?

    Asle Frantzen, Jul 8, 2003, in forum: C++
    Replies:
    5
    Views:
    667
    Kelsey Bjarnason
    Jul 22, 2003
  3. Hubert Hung-Hsien Chang
    Replies:
    2
    Views:
    455
    Michael Foord
    Sep 17, 2004
  4. Replies:
    7
    Views:
    974
  5. HY Tech
    Replies:
    0
    Views:
    616
    HY Tech
    Sep 7, 2003
Loading...

Share This Page