I am not skillful in Java. I wish to create an MP3 player as well
include a function that can trim an MP3 file according to the time I
specify, e.g. cut the MP3 starting from 02:15:43. Does anyone know how
or can you give me some reference or sample?
Thanks.
Oliver Wong - 18 Jul 2006 17:09 GMT
[replying to the subject line]
Yes, it's possible to write a program which trims mp3 files in Java. It
might not be easy however.
>I am not skillful in Java. I wish to create an MP3 player as well
> include a function that can trim an MP3 file according to the time I
> specify, e.g. cut the MP3 starting from 02:15:43. Does anyone know how
> or can you give me some reference or sample?
Are you skillful at programming in general? You'd have to learn the mp3
file format, and do the appropriate manipulations. You can read some
documentation at http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html it
sounds like it's way above your head, you might want to start on an easier
project before tackling this one.
- Oliver
Greg Miller - 19 Jul 2006 04:56 GMT
>I am not skillful in Java. I wish to create an MP3 player as well
>include a function that can trim an MP3 file according to the time I
>specify, e.g. cut the MP3 starting from 02:15:43. Does anyone know how
>or can you give me some reference or sample?
I don't believe there are any native (free) libraries to do it
from Java, but you could build a wrapper around LAME:
http://lame.sourceforge.net/
jmcgill - 19 Jul 2006 05:54 GMT
>> I am not skillful in Java. I wish to create an MP3 player as well
>> include a function that can trim an MP3 file according to the time I
[quoted text clipped - 4 lines]
> from Java, but you could build a wrapper around LAME:
> http://lame.sourceforge.net/
Be aware that MP3 can only be edited in blocks, and cuts are not
possible with much precision. The best you can do is a single "frame",
144 * BitRate / (SampleRate + Padding).
To do what you want to do, you'll have to first analyze the encoding,
and then figure out in frames where you want to decode. It is really
the same problem as implementing fast-forward/rewind in a player.
Here's an implementation of mpeg decoding.
http://www.mp3-tech.org/programmer/sources/JavaLayer0.0.8.tar.gz
totoromacau@gmail.com - 20 Jul 2006 04:14 GMT
Thanks all for your information!