* R0 = Channel number
* R0 Non-zero if a THSound sample is playing on specified channel.
New in version 1.10, remember to check the version if you use this SWI.
This reads data from the SCCB to test whether a THSound voice is currently playing (it won't work for most other samples, because THSound uses the SCCB in a slightly non-standard way). The necessary information in the SCCB is invalid immediately after calling Sound_Control and may wrongly show the channel not to be in use, so if you want to wait for a channel to become free you should use something like:
REM First wait for SCCB to be updated,
REM showing channel is in use
REPEAT
SYS"THSound_ChannelInUse",1 TO inuse%
UNTIL inuse%
REM Now wait until channel is free
REPEAT
SYS"THSound_ChannelInUse",1 TO inuse%
UNTIL NOT inuse%
The second loop can be after, say, a Wimp_Poll, but I suggest you put the first loop immediately after a Sound_Control (or similar) instruction.
|
|
|