Don't know whether a bug in the DLL or a wrong usage: the loop in the example is executed successfully 65 times and the program fails on the 66'th call of `BASS_ChannelIsActive`. The same with different sleep times, so with bigger sleep times it plays longer before failure. The same for different files (MP3 and OGG).
Yet in the example parentheses are missing for `BASS_Free`.