public AudioPlayer(File audioFile, ResourceBundle messages) throws IOException {
this.messages = messages;
try (AudioInputStream in = AudioSystem.getAudioInputStream(audioFile.toURI().toURL())) {
this.audioFile = audioFile;
outFormat = getOutFormat(in.getFormat());
Info info = new Info(SourceDataLine.class, outFormat);
line = (SourceDataLine) AudioSystem.getLine(info);
line.open(outFormat);
} catch (UnsupportedAudioFileException | LineUnavailableException e) {
throw new IOException(e);
}
}
AudioPlayer.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:ProfiSounder
作者:
评论列表
文章目录