Page 1 of 1
Move with sound delay
Posted: Tue Dec 14, 2010 6:11 am
by xfratboy
I'm wondering if there are any suggestions on a minor yet slightly annoying issue I'm having. I'm playing around with moves and sounds. In this stack (see attached) I want to play a sound when a graphic reaches a specific point on a polygon. One thing I'm seeing is that when the sound is started there's a slight but noticeable pause in the movement of the graphic. Does anyone have an idea that could reduce or eliminate this minor pause?
Re: Move with sound delay
Posted: Tue Dec 14, 2010 9:52 am
by jmburnod
Hi xfratboy,
For me the pause happen when the img "alien.png" move over the btns at the top
of cd.
No pause for me if the img "alien.png" don't move over them
Best
Jean-Marc
Re: Move with sound delay
Posted: Tue Dec 14, 2010 10:44 am
by bn
Hi Xfratboy,
I notice the delay only for the first time the sound is played. You could 'initialize' the sound in an opencard handler like this. It apparently loads the sounds into memory.
Code: Select all
on opencard
put the playLoudness into tLoud
set the playLoudness to 0
play SciFi3_L.wav
play SciFi3_R.wav
play stop
set the playLoudness to tLoud
end opencard
in the script of the card. You will not really notice it since both sounds are not really played, the first one is immediately stopped by starting the second one, the second one is immediately stopped by the play stop command and on top you set the playloudness to 0 and restore it afterwards.
Is that what you had in mind?
Kind regards
Bernd
Re: Move with sound delay
Posted: Tue Dec 14, 2010 5:31 pm
by xfratboy
Thanks for the help. Klaus, I tried that. It's REALLY a small delay, but it is still there. It's transient though; it kind of comes and goes. I've tried with variations of move and/or setting the loc vs. using the move command. I experience the same result. It's just enough of a delay to cause the movement to appear to be interrupted. Oh well.
Re: Move with sound delay
Posted: Tue Dec 14, 2010 5:58 pm
by Klaus
Hi xfratboy,
I know that we all look alike for you non-germans, but it was Bernd who provided the above script!
Best
Klaus (not Bernd!)

Re: Move with sound delay
Posted: Tue Dec 14, 2010 6:06 pm
by xfratboy
Oh my gosh that's funny Klaus. OOps!! So sorry Bernd! Thanks BERND!
Re: Move with sound delay
Posted: Tue Dec 14, 2010 6:18 pm
by Klaus
OK, "thou shalt be forgiven"!
Best
Bernd

Re: Move with sound delay
Posted: Tue Dec 14, 2010 9:07 pm
by bn
Hi Xfratboy,
When exactly do you see the interruption of the movement. I only see it when the sound is playing. Other than that you have to bear in mind that Livecode is not the fastest program for animation. You have to use some tricks to get it halfway smooth. I turned off the default button. If you are on a Mac that takes an amazing amount of processor to have the buttons pulsating in blue. That is what the button does if you set it to default.
Then you can tweak the movement a bit by setting the syncrate lower. Contrary to what the dictionary says reducing the syncrate increases the fluency of the movement.
Then it also depends on what processor you have.
I upload a version that has some changes. Tell us what it does. When and What.
regards
Bernd (or Klaus or I don't know who...)
