Wow, so it's an OpenAL problem. How crap is that!?
If you want to rule out the up to 16ms (or so) variation due to Flip, then comment Flip out. OpenAL plays the samples slower than the other two drivers, explain that!
Strict Global CurrentDriver$ Global Channel:TChannel Global TestSound:TSound SetDriver("FreeAudio") 'SetDriver("DirectSound") 'SetDriver("OpenAL") Graphics 400,300,0 Local LastTime = MilliSecs() While Not KeyHit(KEY_ESCAPE) Local now = MilliSecs() 'Play a sound? If now > LastTime+100 Then LastTime = now 'reset CueSound(TestSound,Channel) ResumeChannel(Channel) EndIf 'Change driver? If KeyHit(Key_Space) Then Select CurrentDriver Case "FreeAudio" SetDriver("DirectSound") Case "DirectSound" SetDriver("OpenAL") Case "OpenAL" SetDriver("FreeAudio") End Select EndIf Cls DrawText "Current Driver="+CurrentDriver,10,10 DrawText "Press <escape> to exit",10,30 DrawText "Press <space> to change driver",10,50 Flip Wend Function SetDriver(Driver$) CurrentDriver = Driver SetAudioDriver(Driver) SetupSound() End Function Function SetupSound() Channel = AllocChannel() TestSound = LoadSound("rapid.wav") End Function End
If you want to rule out the up to 16ms (or so) variation due to Flip, then comment Flip out. OpenAL plays the samples slower than the other two drivers, explain that!