Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
623 views
in Technique[技术] by (71.8m points)

api - MP3 Encoding in Java

I need an OpenSource API in Java, which can encode *.wav and *.au formats to MP3 and vice-versa.

I have evaluated Java Sound API and LameOnJ, but they do not meet my requirements and are not stable, respectively. Please suggest one that is free and platform independent.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There may not be an adequate answer for you, yet, as the MP3 format requires the authors of decoder/encoders to obtain a license from the Fraunhofer Institute.

I think the the LAME library is distributed from a country that does not respect these IP issues, but it took a considerably amount of legal hackery to get this far.

For any other libraries - for example one written in Java, the authors need to get a similar license. Where cost is an issue - e.g. in an Open Source project, then this is enough of a disincentive to starting.

For more details see this wikipedia article.

If LAME4J is not stable enough for you, then I'm afraid your options are probably:

  • wait for Sun to license the format for the core JRE. This, I believe they have done recently, but I don't know of any release dates (perhaps to do with JavaFX)
  • implement your own in Java, and pay the license. I wouldn't fancy this one, either.
  • write your own Java wrapper to LAME, via JNA, or SWIG
  • contribute to Lame4J.
  • pick another format. OGG and FLAC are quite good, and relatively well supported.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...