Computer Science Canada Getting an AudioStream to play more than once |
Author: | Nai [ Fri Apr 22, 2011 10:06 pm ] | ||
Post subject: | Getting an AudioStream to play more than once | ||
I'm trying to make a GUI program that involves playing a sound when buttons are pressed. I got the sound to play once when I click a button for the first time, but if I try to click the buttons again after the first time, the audio will not play. It's like the AudioStream objects I'm using to play the sounds can only be played once? Here's basically the code I'm using:
I've also attached a zip file with the whole thing if you care to look at it. Any ideas for this would be helpful, thanks. |
Author: | Nai [ Sun Apr 24, 2011 2:45 pm ] |
Post subject: | RE:Getting an AudioStream to play more than once |
Ok, I got it so never mind. It Involed a Thread.sleep () right after the playing of the clip, and then closing the audiostream and re-opening it. |