Pygame sound delay - Not related to buffer/sampling

后端 未结 2 514
情话喂你
情话喂你 2021-01-15 19:47

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 pres

2条回答
  •  -上瘾入骨i
    2021-01-15 20:14

    In my case I found that it's sufficient to just quit the mixer before it's started (even if it's never been started before):

    pygame.mixer.quit()
    pygame.mixer.init(44100, -16, 2, 1024)
    

提交回复
热议问题