Well, the title says all, I tried playing a wav file using javax.sound and nothing is happening. I have tried many different files without any luck.
public s
Your program is terminating before the sound has the time to be played. I would do play.start(); in some threading way (invokeLater, ...), and also find a way to wait until the sound has finished (Reimeus suggested one).
A lead :
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
...
play.start();
JOptionPane.showMessageDialog(null, "Click OK to stop music");
}
});
}