o algo espero su ayuda saludos...y el archivo smb_stomp.wav si existe... saludos
Código:
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;
import java.io.*;
class Start{
public static void main(String[] args)
{
Musica m=new Musica();
m.playSound();
}
}
class Musica{
public void playSound(){
try{
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("smb_stomp.wav").getAbsoluteFile());
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
}catch(Exception ex){
System.out.println("Error with playing sound.");
ex.printStackTrace();
}
}
}