I am trying to play simple wav files in my little game whenever the user hovers over a button, a little click sound is played (same goes for when the button is actually pressed). With that I encounter the generic lag that everyone who has not initialized the mixer properly does. However, when I correctly initialize it, it still has a .5 second delay. I initialize my game as follows:
pygame.mixer.pre_init(11025, -16, 2, 512)
pygame.mixer.init()
pygame.init()
I have fiddled around (is that a word?) with the different init settings, without success. The wav file is clear and the audio starts immediately from the beginning of the file. So my question is: are there any other ways to remedy the lag that occurs when playing sounds in pygame?
pygame.mixer.pre_init(44100, -16, 2, 2048) # setup mixer to avoid sound lag pygame.init() #initialize pygame pygame.mixer.init(44100, -16, 2, 2048)- marienbad