Code example for SourceDataLine

Methods: open

0
			throws LineUnavailableException {
		DataLine.Info info = new DataLine.Info(SourceDataLine.class, ain
				.getFormat(), ((int) ain.getFrameLength() * audioFormat
				.getFrameSize()));
		clip = (SourceDataLine) AudioSystem.getLine(info);
		clip.open(audioFormat);
		return clip;
	} 
 
	public void stopSound() { 
		if (clip != null) {
			clip.stop();
		} 
		isRunning = false;
	} 
 
	public boolean isVolumeSupported() { 
		return true; 
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java