This commit is contained in:
yugecin 2016-10-11 18:36:28 +02:00
parent a755ff4484
commit d8aaa3e5a4
3 changed files with 23 additions and 18 deletions

View File

@ -241,8 +241,13 @@ public class MultiClip {
*/
public void mute() {
try {
((FloatControl) getClip().getControl(FloatControl.Type.MASTER_GAIN)).setValue((float) (Math.log(Float.MIN_VALUE) / Math.log(10.0) * 20.0));
} catch (Exception e) {
Clip c = getClip();
if (c == null) {
return;
}
((FloatControl) c.getControl(FloatControl.Type.MASTER_GAIN)).setValue((float) (Math.log(Float.MIN_VALUE) / Math.log(10.0) * 20.0));
} catch (LineUnavailableException e) {
e.printStackTrace();
}
}
}