简体   繁体   中英

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 how 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可以将MP3文件转换为AU

我相信使用sox就像这样简单:

sox input.mp3 output.au

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM