对 java 的 MP3/声音库有什么好的建议吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/86083/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Any good recommendations for MP3/Sound libraries for java?
提问by
I'm looking for libraries to:
我正在寻找图书馆:
- read and write meta data (for example ID3v2 tags in mp3 and all)
- convert compressed to to raw audio data and if possible raw audio data to mp3, ogg, aac, ...
- digitally process the audio data (energy, timbre, Mel Frequency Cepstral Coefficients - MFCC, FFT, LPC, Autocorrelation, Wavelet, ...)
- 读取和写入元数据(例如 mp3 和所有中的 ID3v2 标签)
- 将压缩后的音频数据转换为原始音频数据,如果可能,将原始音频数据转换为 mp3、ogg、aac 等
- 数字处理音频数据(能量、音色、梅尔频率倒谱系数 - MFCC、FFT、LPC、自相关、小波、...)
I already know and am not content with:
我已经知道并且不满足于:
- JMF: original from Sun, reads mp3 and turns it into WAV. But does not read meta data nor provide any advanced digital processing features.
- FMJ: Alternative implementation to JMF with same limitations.
- jAudio: Not stable and although potential, currently not well maintained.
- Marsyas: In digital processing just what I had hoped for, but in C++. Maybe some port / integration already available?
- JID3: API for meta data, but seems to be dead (last release 2005/12/10).
- JLayer: API for reading and playing, also dead (last update 2004/11/28).
- MetaMusic: API of the program is neat but no official standalone open source project. Therefore has no community, future support and all...
- Light Dev: Some interesting features, but not at all complete.
- JMF:源自Sun,读取mp3 并将其转换为WAV。但不读取元数据,也不提供任何高级数字处理功能。
- FMJ:具有相同限制的 JMF 的替代实现。
- jAudio:不稳定,虽然有潜力,但目前维护得不好。
- Marsyas:在数字处理方面正是我所希望的,但在 C++ 中。也许一些端口/集成已经可用?
- JID3:元数据的 API,但似乎已死(最新版本 2005/12/10)。
- JLayer:用于阅读和播放的 API,也已死(最后更新 2004/11/28)。
- MetaMusic:程序的 API 很简洁,但没有官方的独立开源项目。因此没有社区,未来的支持和所有......
- Light Dev:一些有趣的功能,但并不完整。
This is what some of my own investigation has turned up. I would greatly appreciate all input, suggestions, critics, ...
这是我自己的一些调查结果。我将不胜感激所有的意见,建议,批评,...
回答by 64BitBob
JLayer should do everything you need. It's not dead, it's just stable. The author finished it up quite a long time ago and the MP3 format has not seen much change since. You'll notice that his MP3SPIcodebase is a little more recent. What MP3SPI does, is that translates JLayer's abilities into JavaSound APIs. Thus you can take any JavaSound code, add MP3SPI to the classpath, and expect that MP3 files will start working. It's pretty nifty. :)
JLayer 应该做你需要的一切。它没有死,它只是稳定。作者很早以前就完成了,从那以后 MP3 格式没有太大变化。您会注意到他的MP3SPI代码库更新一些。MP3SPI 所做的是将 JLayer 的能力转换为 JavaSound API。因此,您可以使用任何 JavaSound 代码,将 MP3SPI 添加到类路径,并期望 MP3 文件将开始工作。它很漂亮。:)
回答by Andreas Holstenson
You should try to looking into gstreamer-java, I've had success with playing media via it and it should be possible to convert audio files with it. There is also JFFMpegthat integrates into JMF, I haven't poked around that much with it so I don't know the total extent of its capabilities and state, but its something to look at more closely.
您应该尝试查看gstreamer-java,我在通过它播放媒体方面取得了成功,并且应该可以使用它来转换音频文件。还有集成到 JMF 中的JFFMpeg,我没有深入研究它,所以我不知道它的功能和状态的总体范围,但它需要更仔细地观察。
回答by Andreas Holstenson
Btw, I've just moved my MetaMusic project to http://github.com/cpesch/MetaMusic/since the infrastructure there is much better.
顺便说一句,我刚刚将我的 MetaMusic 项目移到了http://github.com/cpesch/MetaMusic/,因为那里的基础设施要好得多。
回答by Art Clarke
You could try Xuggler. Here's how it does on your tests:
你可以试试Xuggler。以下是它在您的测试中的表现:
* read and write meta data (for example ID3v2 tags in mp3 and all):
if the underlying container type has meta-data support in FFmpeg, Xuggler supports it.
如果底层容器类型在 FFmpeg 中具有元数据支持,则 Xuggler 支持它。
* convert compressed to to raw audio data and if possible raw audio data to mp3, ogg, aac, ...
Xuggler supports mp3, ogg (vorbis or speex), speex, vorbis, flac, aac, etc.
Xuggler 支持 mp3、ogg(vorbis 或 speex)、speex、vorbis、flac、aac 等。
* digitally process the audio data (energy, timbre, Mel Frequency Cepstral Coefficients - MFCC, FFT, LPC, Autocorrelation, Wavelet, ...)
Xuggler does not have DSP modules so you'll need to find another library for that. But Xuggler will give you the raw data.
Xuggler 没有 DSP 模块,因此您需要为此找到另一个库。但 Xuggler 会给你原始数据。