Java中如何实现音乐的播放

import java.io.FileInputStream;

import javax.swing.JApplet;

import sun.audio.AudioPlayer;
import sun.audio.AudioStream;


public class Sound1 extends JApplet {

/**
* Create the applet.
*/
public static void main(String args[])
{
try {
FileInputStream fileau=new FileInputStream("小.mp3");
AudioStream as=new AudioStream(fileau);
AudioPlayer.player.start(as);
}
catch (Exception e) {}
}





}

posted @ 2017-10-31 04:41  邱海传  阅读(16716)  评论(3编辑  收藏  举报