Home >Java >javaTutorial >Can Java Sound Play MP3 Files?
Java Sound does not support MP3 by default. For types it does support in a specific JRE, check AudioSystem.getAudioFileTypes().
There's a way to add MP3 support. Add the JMF based mp3plugin.jar to your project's run-time class-path.
While a javax.sound.sampled.Clip seems ideal, it can only contain a second of 16-bit stereo sound at a 44.1KHz sampling rate. A alternative is BigClip, which can handle audio of arbitrary size.
The above is the detailed content of Can Java Sound Play MP3 Files?. For more information, please follow other related articles on the PHP Chinese website!