summaryrefslogtreecommitdiff
path: root/src/audio.py
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-09-03 14:39:50 +0200
committerRaindropsSys <contact@minteck.org>2023-09-03 14:39:50 +0200
commit153d21ace9801ac665e2d7f99c967147d1214f29 (patch)
treef363dccf520fbc2c1670d2308b73294fa9ab5676 /src/audio.py
parent6a20ab31ef4d9f6bb0e008b9f1b8d3fbeb6bd956 (diff)
downloadblocks-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.py10
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()