发生某个事件的mp3播放

时间:2014-03-08 08:09:58

标签: java audio wav playback

当我向我的应用程序读取mp3(.wav)文件时,会引发错误

代码:

final String RESOURCE_LOCATION = "D:/capture.wav";
try {
    //AudioInputStream audioIn = AudioSystem.getAudioInputStream(BillForm.class.getResource(RESOURCE_LOCATION));
    AudioInputStream audioIn = AudioSystem.getAudioInputStream(new File(RESOURCE_LOCATION));
    Clip clip = AudioSystem.getClip();
    clip.open(audioIn);
    clip.start();
} catch(Exception e) {
    System.out.println(e);
}

错误是:

  

javax.sound.sampled.LineUnavailableException:行格式为PCM_SIGNED 48000.0 Hz,24位,立体声,6字节/帧,不支持little-endian。

0 个答案:

没有答案