ITeye博客

如何用java播放音乐——jmf

clouisandy · 2011-11-13 20:10 · 编程语言 · Markdown

网速太慢,待续

step1:下载jmf java media framework 已经放到附件中,可以直接下载

step2:简单的实例代码 package org.liujia.game.toolkit.manager.audiomanager;

import java.io.File; import java.net.MalformedURLException;

import javax.media.Manager; import javax.media.Player;

public class MediaPlayerTest{

public static void main(String args) throws MalformedURLException,
		Exception {

	File file = new File("xxxx.mp3");

	Player audioPlayer = Manager.createRealizedPlayer(file.toURL());

	// 这些方法看名字就知道了,你懂的
	audioPlayer.start();
	//audioPlayer.stop(); 
	//audioPlayer.close();
}

}

step3:深入了解 相见http://www.bianceng.cn/Programming/Java/201103/24997.htm

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。