Code example for SourceDataLine

Methods: open

0
	public void setOutput(Line line)
	{ 
		output = (SourceDataLine) line;
		if (output != null) {
			try { 
				output.open(new AudioFormat(8000.0f, 16, 1, true, true));
			} catch (LineUnavailableException e) {
				e.printStackTrace();
			} 
		} 
	} 
 
	public void toggleCapture() 
	{ 
		if (running.get() == 0)
			running.set(1);
		else 
			running.set(0);
	} 
 
Experience pair programming with AI  Get Codota for Java