AudioPlayer.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:ProfiSounder 作者:
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);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号