javax.sound.sampled.LineUnavailableException:为什么会出现此异常? [英] javax.sound.sampled.LineUnavailableException : Why am I getting this exception?

查看:162
本文介绍了javax.sound.sampled.LineUnavailableException:为什么会出现此异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行以下方法时:

private void beep_player_1() {
    try {
        //clip_Player_2.close();
        clip_Player_1 = AudioSystem.getClip();
        ais = AudioSystem.getAudioInputStream(new File(Constants.Player1_Default_Tone)); // PATH FOR THE .WAV FILE
        clip_Player_1.open(ais);
        clip_Player_1.loop(0); // PLAY ONCE
    }catch(Exception exc) {
        System.out.println(exc);
     }
}

抛出

LineUnavailableException .可能是什么原因?

LineUnavailableException get thrown. What could be the reason for this?

javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 44100.0 Hz, 24 bit, stereo, 6 bytes/frame, little-endian not supported.

推荐答案

这可能是什么原因?

What could be the reason for this ?

javax.sound.sampled.LineUnavailableException: line with format 
  PCM_SIGNED 44100.0 Hz, 
  24 bit, 
  stereo, 
  6 bytes/frame, 
  little-endian not supported.

我不知道其余的内容,但是我遇到的大多数PC使用8位或16位位深度",而使用24位.它表示非常精细的记录质量.如果8位是电话质量",而16位是"CD质量",则24位将是主录音质量".

I don't know about the rest, but most PCs I've encountered use 8 or 16 bit 'bit depth' while that uses 24 bits. It indicates a very finely nuanced recording quality. If 8 bit is 'phone quality' and 16 bit is 'CD quality', then 24 bit would be 'master recording quality'.

这篇关于javax.sound.sampled.LineUnavailableException:为什么会出现此异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆