If you don't want to (or can't) upgrade to 8.5 which apparently fixes 
the problem, here is an entirely different approach.

Create a "sound manager"  (or if you are not into object oriented 
programming, a set of related routines a bunch of globals).  Build a 
list of the sounds you want to play with your small half second, or 
one second or two second silence sounds in between.  If you are into 
OOP, put the object into the actorlist so that you get called back in 
your "on stepFrame" handler at every frame event.  In the stepFrame 
handler check to see if the current sound is finished.  If so, delete 
it from the first position in the list, then play the first sound in 
the list.

Completely off the top of my head, completely untested:

-- SoundMgr parent script

property plSounds  -- property which is a list of your sounds

on new me
   plSounds = []
   add(the actorList, me)  -- by doing this, 'on stepFrame' below gets 
called every frame
   return me
end

on mBuildList me
   -- do what ever you do to build up plSounds with your small silence 
sounds in the list
   --  plSounds[1] = "Whatever.snd"
   --  plSounds[2] = "HalfSecondPause.snd"
   -- plSounds[3] = "Another.snd"
   -- etc.
end

-- AND/OR, you can call this to add a sounds one at a time
on mAddToSoundList me, newSoundName
   append(plSounds, newSoundName)
end

on stepFrame me
    if plSounds = [] then
       return
    end if
    if soundBusy(1) then  -- whatever sound channel you want to use
       return  -- still playing, just return
    end if

    -- no sound playing, get the next one
    nextSound = plSounds[1]
    puppetSound 1, nextSound  -- or sound(1).play ...
    deleteAt(plSounds, 1)

    -- do whatever you want with the name of the sound which is in the 
variable: nextSound
end

on mCleanUp me  -- call this when you are ready to quit
   deleteOne(the actorList, me)
end


At 12:48 AM +0200 6/13/01, Michael Nadel wrote:
><snip>
>
>>  Irv's idea is MUCH better.
>
>The problem with Ivr's idea is that the handler "on cuePassed" doesn't seem
>to register cuepoints on very short sounds. For example, if I use a blank
>sound that's only .5 seconds long to space the other sounds, and on that .5
>second sound I put a cuePoint, then when I use the on cuePassed handler, it
>doesn't seem to catch the cuepoint. It works only the first time, but after
>the second time it plays the "blank" sound (after playing a "real" sound) it
>already doesn't catch the cuepoint again! I don't know why. Anybody have any
>ideas? I am desperate to find a reliable way to execute a handler each time
>a sound from the cueList is played.
>

-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to