I\'ve made a button class that checks if a button is selected (when the mouse is hovering over the button). When the button is selected, unselected or clicked it plays a wav
I know this is old, but I found the best solution I have seen so far.
The fix is quite simple actually. I used to have delay in my pygame projects all the time because I would initialize pygame before initializing the mixer. (which always seemed the way you should do it to me).
However if you initialize the mixer before initializing pygame itself it gets rid of all delay. This fixed all my delay problems. hope it helps.
pygame.mixer.pre_init(44100, -16, 2, 2048)
pygame.mixer.init()
pygame.init()