PlaySound weird slowdown issue?

Just starting out? Need help? Post your questions and find answers here.
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

PlaySound weird slowdown issue?

Post by dracflamloc »

Hey guys. I've not been here in a while but I've started messing with a new project in Pb. I've been having an issue with my game not working right once a sound is played.

Could someone confirm for me that they experience the same result with this program:
http://www.dracsoft.com/zips/2ds.zip

Run the game, use WSAD to move around. Note the speed you move. Now left-click to fire, or right-click to reload and thus cause a sound effect to play. The sound plays fine, but all of a sudden the movement speed is practically zero.

The yellow AI players stop moving at the right speed too.

This does *not* happen when I change:

Code: Select all

Procedure PlaySFX(sfx.l, loop.b = 0)
  If IsSound(sfx)
    If loop=1
      PlaySound(sfx,#PB_Sound_Loop)
    Else
      PlaySound(sfx)
    EndIf 
  EndIf 
EndProcedure
To this:

Code: Select all

Procedure PlaySFX(sfx.l, loop.b = 0)
  If IsSound(sfx)
    If loop=1
      ;PlaySound(sfx,#PB_Sound_Loop)
    Else
      ;PlaySound(sfx)
    EndIf 
  EndIf 
EndProcedure
With those two lines commented out, the player does not slow down, and all is normal, (except no sounds).
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Had this with VIA chipset. Be sure to use the correct frequency of your sound (generally 44100Hz), and not more.
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post by Demivec »

@dracflamloc: there is no delay when a sound is played for me. Win XP SP3 (x86) Realtek AC'97 audio .
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

It was an old chipset ;)
It's a known bug, I hang around some days to find it...
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Thanks guys, I'll try that out
Post Reply