在 linux 中此代码不起作用:我添加了两行
// Added two lines.
DataLine.Info info = new DataLine.Info( SourceDataLine.class, audioFormat );
SourceDataLine dataLine = (SourceDataLine) AudioSystem.getLine( info );
// Adjust the volume on the output line.
if( dataLine.isControlSupported( FloatControl.Type.MASTER_GAIN)) {
// If inside this if, the Master_Gain must be supported. Yes?
FloatControl volume = (FloatControl) dataLine.getControl(FloatControl.Type.MASTER_GAIN);
// This line throws an exception. "Master_Gain not supported"
volume.setValue( 100.0F );
}
这是正常的吗?我该怎么做才能解决这个问题?
在windows中它工作。
谢谢,马丁。