Page 1 of 1

Play (audioClip) delay / hang

Posted: Sun Jun 17, 2018 9:40 pm
by SparkOut
A stack with animation has a whistle.wav audioClip imported. When the animation gets to a certain position the sound is supposed to play.

It has been working fine for a considerable time on my old laptop (Windows 10, 32 bit, LC 9.0). I just tried it on a new laptop (Windows 10, 64 bit, LC 9.0) and when the animation reaches the trigger point, everything stops and hangs for 3 or 4 seconds before the sound plays, the animation is halted and then starts again with a jerk once the whistle sound starts.

The code is very simple, just

Code: Select all

play "whistle.wav"
The same happens with

Code: Select all

play audioClip "whistle.wav"
I have used this short uncompressed sound as an imported audioClip for some time, as the overhead is minimal and packaging simple, specifically because I have heard in the past about the delay in a player object buffering up the file before sound emerges, while the audioClip is instant. This seems to be the case no longer on a more modern machine. Any explanation and workaround? I can't have everything stop for tea before the whistle blows.

Re: Play (audioClip) delay / hang

Posted: Mon Jun 18, 2018 9:07 pm
by jiml
I wonder if it would help to silently play the sound clip prior to the animation starting with the sound volume set to zero.
Perhaps that might pre-load the sound and thus avoid the delay.
Just a thought.

Re: Play (audioClip) delay / hang

Posted: Mon Jun 18, 2018 9:14 pm
by jiml
You might also try using a player object with alwaysBuffer set to TRUE

Re: Play (audioClip) delay / hang

Posted: Tue Jun 19, 2018 6:55 am
by SparkOut
Preplaying the audioClip doesn't help. It hangs and delays every time.
I used play audioClip because the sound file is very small and it avoids lots of problems I had with QuickTime and the transition to post-QuickTime after it was deprecated. I can try a player object but I have heard about similar load time delays with a player too. I will see how it goes.

Re: Play (audioClip) delay / hang

Posted: Tue Jun 19, 2018 6:12 pm
by jacque
If you use a player you can preload it with the "prepare" command. It was introduced to prevent delays.

Re: Play (audioClip) delay / hang

Posted: Tue Jun 19, 2018 7:26 pm
by SparkOut
Thanks jwack, I will test that as soon as I can

Re: Play (audioClip) delay / hang

Posted: Tue Jun 19, 2018 7:50 pm
by jacque
You've been checking up on me. :D

Re: Play (audioClip) delay / hang

Posted: Tue Jun 19, 2018 9:43 pm
by SparkOut
Haha, that's of old, I always think "jwack" the same as I can't help but say "Klausimausi" :)

Re: Play (audioClip) delay / hang

Posted: Sun Jun 24, 2018 7:44 am
by SparkOut
Prepare doesn't help, and the issue remains whether using an audioClip or player. Any ideas?