Results 21 to 25 of 25
Thread: Playing audio clips
- 06-25-2012, 11:06 PM #21
Member
- Join Date
- Feb 2011
- Posts
- 58
- Rep Power
- 0
- 06-26-2012, 01:01 AM #22
Re: Playing audio clips
When there were overlapping calls to the play() method, sometimes a play of the sound was missed. When I added code to serialize the play using Semaphore and sleep() all the calls to play() made sounds.
If you don't understand my response, don't ignore it, ask a question.
- 06-26-2012, 06:59 PM #23
Member
- Join Date
- Feb 2011
- Posts
- 58
- Rep Power
- 0
Re: Playing audio clips
OK, thank you. I have made significant progress. I created a 1sec wav file to make it easier to hear the interruptions. From this I could clearly see that the AudioClip.play() method returns immediately. Which leads me to think that there's no need to run it on another thread (it creates it's own thread), please correct me if I'm wrong. I got rid of my new thread and it ran on the EDT with the same results as before.
I could also see that sometimes the old sound was cleanly interrupted by the new one, but sometimes the new one just stopped the old one and the new one didn't play. So I put a sound.stop() before the sound.play() and, except when I try and make them play ridiculously fast, they never fail to play. This just leads me to ask one more question. Since play() appears to create its own new thread is it OK to call it on the EDT?
- 06-26-2012, 07:02 PM #24
Re: Playing audio clips
Since it returns immediately, it's probably OK.
If you don't understand my response, don't ignore it, ask a question.
- 06-26-2012, 07:14 PM #25
Member
- Join Date
- Feb 2011
- Posts
- 58
- Rep Power
- 0
Similar Threads
-
playing wav files
By treeface99 in forum New To JavaReplies: 12Last Post: 02-07-2012, 12:12 PM -
Playing a WAV or MP3
By meesterpickles in forum New To JavaReplies: 7Last Post: 12-19-2011, 02:59 AM -
Video clips in side bar start playing automagically.
By JosAH in forum Suggestions & FeedbackReplies: 10Last Post: 05-26-2011, 09:01 AM -
Highlight text on playing audio
By archanaanbu in forum Java AppletsReplies: 1Last Post: 02-22-2011, 01:34 PM -
playing audio in J-App??
By ashton in forum New To JavaReplies: 3Last Post: 01-30-2009, 08:50 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks