Results 1 to 12 of 12
Thread: Music File Conversion
- 04-16-2008, 12:59 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 6
- Rep Power
- 0
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
- 04-17-2008, 08:34 AM #2
How you also ask Google about this?
regards,
sukatoa
- 04-17-2008, 11:15 AM #3
Member
- Join Date
- Apr 2008
- Posts
- 6
- Rep Power
- 0
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.
- 04-17-2008, 11:48 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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.
- 04-17-2008, 12:07 PM #5
Member
- Join Date
- Apr 2008
- Posts
- 6
- Rep Power
- 0
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.
- 04-17-2008, 12:50 PM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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.
- 04-17-2008, 02:20 PM #7
Member
- Join Date
- Apr 2008
- Posts
- 6
- Rep Power
- 0
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!
- 04-18-2008, 03:54 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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.
- 04-18-2008, 10:53 AM #9
Member
- Join Date
- Apr 2008
- Posts
- 6
- Rep Power
- 0
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.
- 04-18-2008, 10:55 AM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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 :)
- 04-18-2008, 03:59 PM #11
Member
- Join Date
- Apr 2008
- Posts
- 6
- Rep Power
- 0
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.
- 04-21-2008, 03:30 AM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
That's good, you found the way at the end. Try and see :)
Similar Threads
-
getting a music file onto File
By geork in forum Advanced JavaReplies: 1Last Post: 03-03-2008, 04:34 PM -
getting a music file onto File
By geork in forum Advanced JavaReplies: 0Last Post: 02-07-2008, 07:55 PM -
printing MIDI notes on a music staff
By kbyrne in forum Advanced JavaReplies: 0Last Post: 12-29-2007, 07:50 PM -
printing MIDI notes on a music staff
By kbyrne in forum AWT / SwingReplies: 0Last Post: 12-29-2007, 05:30 PM -
Regarding conversion of Image file to Video file
By RamaDeviMsc in forum Advanced JavaReplies: 0Last Post: 06-25-2007, 02:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks