Calling stop() on a playing AudioClip takes a long time -- roughly 20-30 milliseconds, enough to cause a visual stutter in an app that updates at 60 fps (via an AnimationTimer).
There is no delay or lag if an AudioClip finishes playing on its own.
I have created a test app which measures the lag:
http://electronzen.com/AudioClipTest/
Launch the app. Press Play to start the clip. Press Stop when the clip is playing to see the frame time delta jump.
There is no delay or lag if an AudioClip finishes playing on its own.
I have created a test app which measures the lag:
http://electronzen.com/AudioClipTest/
Launch the app. Press Play to start the clip. Press Stop when the clip is playing to see the frame time delta jump.