playing = IsSamplePlaying(id)
idis currently playing and returns
Trueif it is,
Trueif the sample specified by
LoadSample(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).