开发者

AU audio files for Java

Apparently Java only plays .au audio files and I want to play mp3 files. I want to convert them to au and do not want to use any third party library to play mp3 directly. Can you please let me know ho开发者_如何学Cw I can prepare my mp3 files to be able to play them in Java. (specifically I'd like to convert mp3 files to au files with a freeware software but don't know any software that is capable of doing that)


Is your target platform Windows only? If so you might want to investigate JMF.

Otherwise, there's a nice guide here on extending JavaSound to play MP3s using MP3 SPI.

Overall, I'm finding your question is confusing. The act of decoding a MP3 file is to convert it to raw audio. Once done there is little point in then converting it again to the AU and then using the native Java API to play it - you might as well just play it straight after it's decoded into raw audio. Furthermore, if as your question implies you don't want to use third-party libraries at all, then you'll need to write your own MP3 decoder.


Audacity can convert MP3 files to AU


With sox I believe it's as simple as:

sox input.mp3 output.au
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜