FutureBasic Logo

<<    Index    >> FutureBasic 5

sound%   function



Syntax:
soundIsPlaying = sound%

Description:
This function returns _zTrue if a sound is currently playing, or _false otherwise. This applies to sounds that you play using the sound <frequency> statement or the sound <snd> statement, but does not apply to Text-to-speech sounds.

Example:
The sound% function is useful for determining when an asynchronous sound has finished playing.
sound "Quack"
startTime& = fn TickCount
while sound%
wend
endTime& = fn TickCount
print "That sound lasted"; endTime& - startTime&; "ticks."


Note:
To determine whether a Text-to-speech sound is currently playing, use the Toolbox function fn SPEECHBUSY.

See Also:
sound <frequency>; sound <snd>; sound end