上传者: MISS_CAICAI
|
上传时间: 2023-02-14 22:28:46
|
文件大小: 140KB
|
文件类型: JAR
if(!Thread.currentThread().isInterrupted()) {
System.out.println(!Thread.currentThread().isInterrupted());
//声明一个File对象
File mp3 = new File("E:\\Download\\10092.mp3");
//创建一个输入流
FileInputStream fileInputStream;
try {
fileInputStream = new FileInputStream(mp3);
//创建一个缓冲流
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
//创建播放器对象,把文件的缓冲流传入进去
player = new Player(bufferedInputStream);
//调用播放方法进行播放
player.play();
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (JavaLayerException e) {
e.printStackTrace();
}
}