private void init(AudioFormat baseFormat) throws LineUnavailableException {
decodedFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, baseFormat.getSampleRate(), 16, baseFormat.getChannels(),
baseFormat.getChannels() * 2, baseFormat.getSampleRate(), false);
DataLine.Info info = new DataLine.Info(SourceDataLine.class, decodedFormat);
line = (SourceDataLine) AudioSystem.getLine(info);
line.open(decodedFormat);
volumeControl = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
minGainDB = volumeControl.getMinimum();
ampGainDB = ((10.0f / 20.0f) * volumeControl.getMaximum()) - volumeControl.getMinimum();
cste = Math.log(10.0) / 20;
line.start();
//App.logger.d("prefix + WebPlayer SourceDataLine started!", null);
}
SingleSongPlayer.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:SoundCenterClient
作者:
评论列表
文章目录