Clip not playing any sound

后端 未结 6 989
迷失自我
迷失自我 2020-12-12 06:11

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         


        
6条回答
  •  不思量自难忘°
    2020-12-12 06:38

    Java's sound Clip requires an active Thread to play the audio input file otherwise the application exits before the file can be played. You could add

    JOptionPane.showMessageDialog(null, "Click OK to stop music");
    

    after calling start.

提交回复
热议问题