import java.net.*;
import java.io.*;
import javax.sound.sampled.*;
public class Sampled{
public static void main(String[] args){
try{//author : tdundaralp@msn.com
// Toygar Dundaralp
AudioInputStream stream
= AudioSystem.getAudioInputStream(new File("1-welcome.wav"));
AudioFormat format = stream.getFormat();
DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(),
((int)stream.getFrameLength()*format.getFrameSize()));
Clip clip = (Clip) AudioSystem.getLine(info);
clip.open(stream);
clip.start();
}
catch (Exception e){
e.printStackTrace();
}
}
}