Results 1 to 12 of 12
  1. #1
    Dave Almighty is offline Member
    Join Date
    Apr 2008
    Posts
    6
    Rep Power
    0

    Red face Music File Conversion

    Hi there,

    I'm trying to get some code going to convert a given m4a file to mp3 format using java.. I know that Java has some built-in music conversion abilities..but only for really bizarre formats like ogg and midi files..

    Does anyone know of any libraries out there that supports music file conversion (specifically mp3)..

    This is a small but vital part of a program I'm working on.. and it will take forever to do from scratch. Any help would be GREATLY appreciated. Thanks,

    Kind regards,

    David

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    How you also ask Google about this?

    regards,
    sukatoa

  3. #3
    Dave Almighty is offline Member
    Join Date
    Apr 2008
    Posts
    6
    Rep Power
    0

    Default Of course!

    Yes, I've done searches on google ... what feels like hundreds; I've spent hours and hours trying to find a way, which is why I'm here.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    I'm not 100% sure, but there is two utilities for Linux called lame and faad. There is no a direct/one utility to do this conversion. Using those two it is possible.

    Google it. May be the spellings of words can be wrong, if so really sorry about that.

  5. #5
    Dave Almighty is offline Member
    Join Date
    Apr 2008
    Posts
    6
    Rep Power
    0

    Default

    Hi there, thanks for the reply.

    I've checked it out, and while this is the type of thing I'm looking for, it's source files are all C, and I need to use this code in an applet, so it needs to be Java.

    I think this might end up with me having to look through the byte patterns of audio files, argh. Does anyone reckon that's possible with Java... just to work out how the bytes and headers are formed in one type of file, and use plain Java to create a new file of the correct format?

    I'm a novice in the area of conversion.. but that's the only way (albeit incredibly time-consuming and far from ideal) I can see around it!

    Any tips or ideas are greatly appreciated, thanks.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    You can use read() method of the InputStream to read a single byte. But I haven't done such a thing before and I don't know how difficult it is.

  7. #7
    Dave Almighty is offline Member
    Join Date
    Apr 2008
    Posts
    6
    Rep Power
    0

    Default

    It's a tricky one..

    I don't suppose there's any way to run C code from a java applet? So that I could use faad and lame? I can't BELIEVE there isn't a java library to do this out there somewhere.. I can't be the first one to want to use java for this reason.

    I wouldn't mind creating it from scratch if I had to; it's just impossible to find information about the exact layout of mp3/m4a files.. i.e. right down to which byte shows what in terms of header info etc.

    I've never had a situation where I couldn't find a solution to a programming problem, no matter how hard I tried... and I'm determined not to let that happen!

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Yes, you are not the first person wants to do this. I heard about few people done this before and all of them are used faad and lame mechanism. It can tricky too, if so why are you worried about that. Even using a tricky way you can make your success. I have work out on large number of tricky events in my life.

  9. #9
    Dave Almighty is offline Member
    Join Date
    Apr 2008
    Posts
    6
    Rep Power
    0

    Default

    I wasn't saying using faad and lame was tricky - that looks simple, only requires a couple of lines of code.. though its source is in C, so don't think there's a way to do this.

    What's tricky is getting the very highest technical detail about these files, going laboriously through the byte sequences manually, working out all the crazy header information, etc.. for two sets of file types.. it's a lot of work, for something I would have hoped had already been worked out by an ardent music lover somewhere out there in the java community.

    Will that person have to be me? I hope not.

  10. #10
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Yes, as you said working in byte level is not a good choice, because you have to do lots of works.

    Are you sure that faad-lame is in C, because my friend says that his application design to work for Linux. Better to check it again me too :)

  11. #11
    Dave Almighty is offline Member
    Join Date
    Apr 2008
    Posts
    6
    Rep Power
    0

    Default

    Hey hey, I think I've hit the jackpot:

    LAMEOnJ - The LAME symmetric Java MP3 encoder API

    Looks like there's a java api for Lame (which is written in C)... this is just what I was looking for! I only managed to find it after I began researching the indepth mechanics of mp3 file structure.

    I'll let you know if I get anywhere with this, Thanks.

  12. #12
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. getting a music file onto File
    By geork in forum Advanced Java
    Replies: 1
    Last Post: 03-03-2008, 04:34 PM
  2. getting a music file onto File
    By geork in forum Advanced Java
    Replies: 0
    Last Post: 02-07-2008, 07:55 PM
  3. printing MIDI notes on a music staff
    By kbyrne in forum Advanced Java
    Replies: 0
    Last Post: 12-29-2007, 07:50 PM
  4. printing MIDI notes on a music staff
    By kbyrne in forum AWT / Swing
    Replies: 0
    Last Post: 12-29-2007, 05:30 PM
  5. Regarding conversion of Image file to Video file
    By RamaDeviMsc in forum Advanced Java
    Replies: 0
    Last Post: 06-25-2007, 02:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •