Playing audio files consecutively

Scott Rossi scott at tactilemedia.com
Mon Apr 16 14:13:52 EDT 2007


>> I am sure that this problem has been solved many times but I am
>> just playing with runrev right now and am experiencing some
>> difficulty.

> The playStopped message works only with player objects, not with the
> play command.

Actually the docs state that playStopped works with audioClips and a quick
test here does indeed confirm this (v2.7.4 OSX)

Perhaps you did not place your playStopped handler so it would operate as
part of the message hierarchy.  The playStopped message is apparently sent
to the audioClip being played, so it would be best to place the handler in
the card script or stack script.  What I did:

[button script]
 on mouseUp
   play audioClip 1
 end mouseUp

[card script]
 on playStopped theClip
   answer "done!"
 end playStopped

You can also accomplish the above using a "wait" within the button script:

 on mouseUp
   play audioClip 1
   wait until the sound is "done" with messages -- ALLOW OTHER EVENTS
   answer "done!"
 end mouseUp

Note that both of these techniques may introduce a brief pause between
playback of clips.  You may want to try a multi-player set up of loading
sounds into alternate player objects and starting/stopping each to minimize
any delay, if seamless playback is something you're after.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design





More information about the use-livecode mailing list