More work on trying to reduce pops and clicks, especially in Windows.
This commit is contained in:
11
display.py
11
display.py
@@ -44,11 +44,12 @@ def initialize_gui(gameTitle):
|
||||
pygame.display.set_mode((800, 600))
|
||||
pygame.display.set_caption(gameTitle)
|
||||
|
||||
# Set up audio system
|
||||
pygame.mixer.pre_init(44100, -16, 2, 512)
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.set_num_channels(32)
|
||||
pygame.mixer.set_reserved(0) # Reserve channel for cut scenes
|
||||
# Initialize audio system if not already done
|
||||
if not pygame.mixer.get_init():
|
||||
pygame.mixer.pre_init(44100, -16, 2, 1536)
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.set_num_channels(64)
|
||||
pygame.mixer.set_reserved(0) # Reserve channel for cut scenes
|
||||
|
||||
# Enable key repeat for volume controls
|
||||
pygame.key.set_repeat(500, 100)
|
||||
|
Reference in New Issue
Block a user