如何成功播放.mp3文件
这个问题在这里已经有了答案:
检查Xuggle或jLayer。
谷歌他们,你会得出很好的结果。
好>> http://kxhitiz.blogspot.com.tr/2010/09/playing-mp3-in-java-programming.html
Java Jlayer MP3播放器 - 如何重复和停止歌曲
public class JavaAudioPlaySoundExample
{
public static void main(String[] args)
throws Exception
{
// open the sound file as a Java input stream
String gongFile = "/Users/al/DevDaily/Projects/MeditationApp/resources/gong.au";
InputStream in = new FileInputStream(gongFile);
// create an audiostream from the inputstream
AudioStream audioStream = new AudioStream(in);
// play the audio clip with the audioplayer class
AudioPlayer.player.start(audioStream);
}
}
链接地址: http://www.djcxy.com/p/73803.html