Friday, 15 August 2014

linux - Java: Master Gain not supported exception -


This code does not work in Linux: I've added two rows

  // added two lines of DataLine.Info information = New DataLine.Info (SourceDataLine.class, audioFormat); SourceDataLineDocumentline = (SourceDataLine) AudioSystemGateline (notification); // Adjust the volume on the output line if (dataLine.isControlSupported (FloatControl.Type.MASTER_GAIN)) {// If inside this, Master_Gain should be supported. Yes? Float Control Volume = (Float Control) DataLine .getControl (Float Control .MASTER_GAIN); // This line throws an exception "Master_Gain is not supported" volume.setValue (100.0F); }  

Is this normal? What do I have to do to solve this?
This works in the window.

Thanks, Martijn.

class = "post-text" itemprop = "text">

Before you try to use this control, open () line? Something like this:

  // Add two rows DataLine.Info information = New DataLine.Info (SourceDataLine.class, audioFormat); SourceDataLineDocumentline = (SourceDataLine) AudioSystemGateline (notification); DataLine.open (); // Adjust the volume on the output line if (dataLine.isControlSupported (FloatControl.Type.MASTER_GAIN)) {// If inside this, Master_Gain should be supported. Yes? Float Control Volume = (Float Control) DataLine .getControl (Float Control .MASTER_GAIN); // This line throws an exception "Master_Gain is not supported" volume.setValue (100.0F); }  

No comments:

Post a Comment