diff options
author | RaindropsSys <contact@minteck.org> | 2023-09-03 14:39:50 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-09-03 14:39:50 +0200 |
commit | 153d21ace9801ac665e2d7f99c967147d1214f29 (patch) | |
tree | f363dccf520fbc2c1670d2308b73294fa9ab5676 /src/audio.py | |
parent | 6a20ab31ef4d9f6bb0e008b9f1b8d3fbeb6bd956 (diff) | |
download | blocks-153d21ace9801ac665e2d7f99c967147d1214f29.tar.gz blocks-153d21ace9801ac665e2d7f99c967147d1214f29.tar.bz2 blocks-153d21ace9801ac665e2d7f99c967147d1214f29.zip |
Updated 16 files and added 5 files (automated)
Diffstat (limited to 'src/audio.py')
-rw-r--r-- | src/audio.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/audio.py b/src/audio.py index 1d8f725..169c886 100644 --- a/src/audio.py +++ b/src/audio.py @@ -1,10 +1,14 @@ import pygame import random -enable_audio = False +enable_audio = True + +try: + pygame.mixer.init() +except pygame.error: + print("WARNING: Failed to initialize DSP mixer.") + enable_audio = False -pygame.mixer.pre_init(48000, -16, 2, 2048) -pygame.mixer.init() pygame.mixer.set_num_channels(3) pygame.mixer.stop() |