javax.sound.sampled.BooleanControl#setValue ( )源码实例Demo

下面列出了javax.sound.sampled.BooleanControl#setValue ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: mars-sim   文件: OGGSoundClip.java
public void setMute(boolean mute) {
		// Set mute value.
		this.mute = mute;

		if (outputLine == null) {
			return;
		} else if (outputLine.isControlSupported(BooleanControl.Type.MUTE)) {
			BooleanControl muteControl = (BooleanControl) outputLine.getControl(BooleanControl.Type.MUTE);
			muteControl.setValue(mute);

			 if (mute)
				 paused = true;
			 else
				 paused = false;
			 
//			 if (!mute)
//			 setGain(oldGain);
		}

	}
 
源代码2 项目: open-ig   文件: AudioThread.java
/**
 * Mute or unmute the current playback.
 * @param mute the mute status
 */
public void setMute(boolean mute) {
	BooleanControl bc = (BooleanControl)sdl.getControl(BooleanControl.Type.MUTE);
	if (bc != null) {
		bc.setValue(mute);
	}
}
 
源代码3 项目: Spark   文件: JavaMixer.java
public void setMicrophoneInput() {
    TreePath path = findByName(new TreePath(root), new String[]{"MICROPHONE", "Select"});

    if (path == null) {
        path = findByName(new TreePath(root), new String[]{"Capture source", "Capture", "Mute"});
    }

    if (path != null) {
        if (path.getLastPathComponent() instanceof JavaMixer.ControlNode) {
            BooleanControl bControl = (BooleanControl) (((JavaMixer.ControlNode) path.getLastPathComponent()).getControl());
            bControl.setValue(true);
        }
    }
}
 
源代码4 项目: Spark   文件: JavaMixer.java
public void setMuteForMicrophoneOutput() {
    TreePath path = findByName(new TreePath(root), new String[]{"SPEAKER", "Microfone", "Mute"});

    if (path == null) {
        path = findByName(new TreePath(root), new String[]{"MIC target", "mic", "Mute"});
    }

    if (path != null) {
        if (path.getLastPathComponent() instanceof JavaMixer.ControlNode) {
            BooleanControl bControl = (BooleanControl) (((JavaMixer.ControlNode) path.getLastPathComponent()).getControl());
            bControl.setValue(true);
        }
    }
}
 
 同类方法