Fred> it was the reason why the ball slowed down on white tiles


KarLKoX wrote:The rule : always set the sampling freq according to the native sampling freq of your spu (ie : 48khz for a creative soundcard).
Despite this, crappy soundcard drivers can also be the cause ... (ie: hdaudio, ac97 ...)
Code: Select all
;******************************************************************************************************
; Play specified sound specifying parameters
Procedure play_sound(sound.l, pan.l = -1, volume.l = -1, frequency.l = -1)
If pan <> -1
SoundPan( sound, pan )
EndIf
If volume <> -1
SoundVolume( sound, volume )
EndIf
If frequency <> -1
SoundFrequency( sound, frequency )
EndIf
PlaySound( sound, #PB_Sound_MultiChannel )
EndProcedure
;******************************************************************************************************
InitSprite()
InitSound()
If LoadSound(0, "mysound.wav")
;OK
play_sound(0, 0, 100, 44100)
;On some soundcards, pauses the program for some ms
play_sound(0, 0, 100, 50000)
EndIf
End