Fred> it was the reason why the ball slowed down on white tiles
Good to know about sound
Good to know about sound
As I've spent several hours on this bug, let me share it. On some computers, playing a sound with a frequency > 44100 slows down everything. Don't ask me why ; I don't think it's a PB bug but an hardware problem. :roll:
Fred> it was the reason why the ball slowed down on white tiles
I've totally revamped the collision engine only for that, but it was NOT the collision engine! 
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 ...)
I just wanted to use the same sound with different frequencies... I'll add this on my todo list : testing soundcard capabilities before using it.
Pseudo-code to not be "off topic"
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

