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)
+2
A:
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.
Catchwa
2009-11-04 09:30:04
Maybe he's trying to avoid licence costs from redistributing an mp3 decoder?
wds
2009-11-04 12:33:54