Play (audioClip) delay / hang

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
SparkOut
Posts: 1822
Joined: Sun Sep 23, 2007 4:58 pm

Play (audioClip) delay / hang

Post by SparkOut » Sun Jun 17, 2018 9:40 pm

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.

jiml
Posts: 168
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Play (audioClip) delay / hang

Post by jiml » Mon Jun 18, 2018 9:07 pm

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.

jiml
Posts: 168
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Play (audioClip) delay / hang

Post by jiml » Mon Jun 18, 2018 9:14 pm

You might also try using a player object with alwaysBuffer set to TRUE

SparkOut
Posts: 1822
Joined: Sun Sep 23, 2007 4:58 pm

Re: Play (audioClip) delay / hang

Post by SparkOut » Tue Jun 19, 2018 6:55 am

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.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4697
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Play (audioClip) delay / hang

Post by jacque » Tue Jun 19, 2018 6:12 pm

If you use a player you can preload it with the "prepare" command. It was introduced to prevent delays.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SparkOut
Posts: 1822
Joined: Sun Sep 23, 2007 4:58 pm

Re: Play (audioClip) delay / hang

Post by SparkOut » Tue Jun 19, 2018 7:26 pm

Thanks jwack, I will test that as soon as I can

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4697
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Play (audioClip) delay / hang

Post by jacque » Tue Jun 19, 2018 7:50 pm

You've been checking up on me. :D
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SparkOut
Posts: 1822
Joined: Sun Sep 23, 2007 4:58 pm

Re: Play (audioClip) delay / hang

Post by SparkOut » Tue Jun 19, 2018 9:43 pm

Haha, that's of old, I always think "jwack" the same as I can't help but say "Klausimausi" :)

SparkOut
Posts: 1822
Joined: Sun Sep 23, 2007 4:58 pm

Re: Play (audioClip) delay / hang

Post by SparkOut » Sun Jun 24, 2018 7:44 am

Prepare doesn't help, and the issue remains whether using an audioClip or player. Any ideas?

Post Reply

Return to “Bug Triage”