send command hiccups?

Nicolas Cueto niconiko at gmail.com
Thu May 17 02:28:47 EDT 2012


Hello All,

For a spinning wheel-of-fortune effect, I want a "ding" sound to
repeat at even intervals. And I'd like those intervals to be as short
as audibly possible without the sound file being too cut-off.

Using the script below, the "play 'ding'" audibly cycles at an even
metre a few times, but, after the nth time, there's a very brief but
clearly perceivable pause or hiccup. When that "nth" time happens
depends on the wait time of the "send" command, but it's about every
6th to 11th cycle.

I've tried playing with the send time, as well as editing the original
sound file to be as audibly brief as possible.  In fact, I've been
attacking this "hiccup" problem on-and-off over the years. One
"solution" I've tried is to string the dings into a new sound file and
use a player object to play it. But, at some point, when that spinning
wheel starts visually slowing down, I just don't see any way of
getting around the problem that I must rely on a delaying send-in-time
command to make the wheel also sound like it's slowing down.

Thank you in advance.  -- Nicolas Cueto


THE SCRIPT...

on mouseUp
   set the cpFlag of me to not the cpFlag of me
   switch the cpFlag of me
      case "true"
         set the label of me to "S T O P"
         send "dingDing" to me in 0 milliseconds
         break
      case "false"
         set the label of me to "D I N G"
         break
   end switch
end mouseUp

on dingDing
   if the cpFlag of me is false then exit dingDing
   play "ding" -- an au file, length of 0.089 seconds
   put field "sendWait" into tSendWaittime_ding
   if tSendWaittime_ding <= 0 then put 90 into tSendWaittime_ding
   send "dingDing" to me in tSendWaittime_ding milliseconds
end dingDing




More information about the Use-livecode mailing list