playing = IsSamplePlaying(id)
id
is currently
playing and returns True
if it is, False
otherwise.
True
if the sample specified by id
is playing, False
otherwiseLoadSample(1, "Sound/Samples/ChurchOrgan.wav") PlaySample(1) Repeat Wait(2) Until IsSamplePlaying(1) = False FreeSample(1)The above code loads the sample "Sound/Samples/ChurchOrgan.wav", plays it and then waits for it to finish. After that, the sample is freed. If you just want to do something like above, it is easier for you to use the WaitSampleEnd() command. But if you want to do some things during the sample is playing, you will have to do it this way (using
IsSamplePlaying()
and a loop).