import java.io.FileInputStream;
import sun.audio.AudioPlayer;
import sun.audio.AudioStream;
public class Sound {
public static void main(String args[]) {
try {
// 1.wav 文件放在java project 下面
FileInputStream fileau = new FileInputStream(
System.getProperty("user.dir") + "\\1.wav");
AudioStream as = new AudioStream(fileau);
AudioPlayer.player.start(as);
} catch (Exception e) {
e.printStackTrace();
}
}
wav声音文件可以从下面下载:
http://game.3533.com/lingsheng/wav/