Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AudioClip has noticeable delay when play called the first time

jmartSep 10 2012 — edited Sep 12 2012
hello,


I have added sound effect in an app i'm working on. When a user presses the mouse button all this stuff happens on the screen and an AudioClip is played. What I am noticing is that the AudioClip playback is noticeably delayed on the first play back.

If I have priority set to 0, the delay goes away somewhat if I keep pressing buttons, to keep the audio playing, but then comes back if I pause for a few seconds then start again. If I have the priority set to 1 the delay only happens on the first occurrence, but went away for every other occurrence.

I even added the playing of the audio as an event filter to the MOUSE_CLICKED event so that it is processed first before the event handler. But this had no effect.

Anyone else experience this and know how to remedy it? In my app I plan to have many AudioClips that must play right away without any delay.

thanks
jose
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2012
Added on Sep 10 2012
1 comment
367 views