Pygame - Sound delay

前端 未结 7 1263
广开言路
广开言路 2020-12-16 01:32

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

7条回答
  •  余生分开走
    2020-12-16 02:20

    I had a sound delay, too. Now, this works fine for me:

    pg.mixer.pre_init(44100, -16, 1, 512)
    pg.init()
    pg.mixer.init()
    

    With pg.mixer.pre_init(22100, -16, 2, 64) the sound plays faster but is twisted, okay for sound effects but not for real music as background.

提交回复
热议问题