package com.stevezong.mp3palyer;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;
public class Palyer {
public static void main(String[] args) {
try {
File file = new File("d:/music");
File[] files = file.listFiles();
for(File sub:files){
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sub));
Player player =new Player(bis);
player.play();
player.close();
}
} catch (JavaLayerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
java mp3 播放器
最新推荐文章于 2024-08-29 19:04:10 发布