Java examples for javax.sound.sampled:Sound
open sound Line
// All rights reserved. //package com.java2s; import javax.sound.sampled.*; public class Main { public static SourceDataLine openLine(final AudioFormat audioFormat) throws LineUnavailableException { DataLine.Info dataLineInfo = new DataLine.Info( SourceDataLine.class, audioFormat); Line line = AudioSystem.getLine(dataLineInfo); SourceDataLine sourceDataLine = (SourceDataLine) line; sourceDataLine.open(audioFormat); sourceDataLine.start();//from w w w.ja v a 2 s. co m return sourceDataLine; } }