Code example for SourceDataLine

Methods: getControlisControlSupported

0
    public boolean hasGainControl() { 
        if (gainControl == null) {
            // Try to get Gain control again (to support J2SE 1.5) 
            if ((sourceDataLine != null)
                    && (sourceDataLine
                            .isControlSupported(FloatControl.Type.MASTER_GAIN)))
                gainControl = (FloatControl) sourceDataLine
                        .getControl(FloatControl.Type.MASTER_GAIN);
        } 
        return gainControl != null;
    } 
 
    /** 
     * Sets the gain(volume) for the outputline 
     *  
     * @param gain [0.0 <-> 1.0] 
     * @throws IOException thrown when the soundcard does not support this 
     *         operation 
     */ 
    public void setGain(double fGain) throws IOException {
Contextual code suggestions in your IDE  Get Codota for Java