class PlayThread extends Thread{
byte tempBuffer[] = new byte[10000];
public void run(){
try{
sourceDataLine.open(audioFormat);
sourceDataLine.start();
}catch (Exception e) {
e.printStackTrace();
System.exit(0);
}//end catch
}//end run
}//end inner class PlayThread
private void playAudio () {
try{
File soundFile =
new File("/home/Adriano/Scrivania/Documento 1 non salvato");
audioInputStream = AudioSystem.
getAudioInputStream(soundFile);
DataLine.Info dataLineInfo =
new DataLine.Info(
SourceDataLine.class,
audioFormat);
sourceDataLine =
(SourceDataLine)AudioSystem.getLine(
dataLineInfo);
new PlayThread().start();
}catch (Exception e) {
e.printStackTrace();
System.exit(0);
}//end catch
}//end playAudio