public AudioPlayer(InputStream in, Listener listener) throws Exception {
this.in = in;
this.listener = listener;
AudioFormat format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100.0F, 16, 2, 4, 44100.0F, true);
line = AudioSystem.getSourceDataLine(format);
line.open(format);
LOG.debug("Opened line " + line);
if (line.isControlSupported(FloatControl.Type.MASTER_GAIN)) {
gainControl = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
setGain(DEFAULT_GAIN);
}
new AudioDataWriter();
}
AudioPlayer.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:airsonic
作者:
评论列表
文章目录