Code example for SourceDataLine

Methods: getControlisControlSupported

0
        return pos;
    } 
 
    public void setLineGain(float gain) {
        if (source != null) {
            if (source.isControlSupported(FloatControl.Type.MASTER_GAIN)) {
                FloatControl volControl = (FloatControl) source.getControl(FloatControl.Type.MASTER_GAIN);
                float newGain = Math.min(Math.max(gain, volControl.getMinimum()), volControl.getMaximum());
 
                volControl.setValue(newGain);
            } 
        } 
    } 
     
    public float getMaxGain() { 
//        boolean test = false; 
//        try { 
//            if (source == null) { 
//                test = true; 
//                if(testSource == null) { 
Contextual code suggestions in your IDE  Get Codota for Java