fixxed alsa sound problems
This commit is contained in:
+9
-6
@@ -29,13 +29,16 @@ DEFAULT_MAX_PER_HOUR = 2
|
||||
DEFAULT_WINDOW_SECONDS = 3600
|
||||
|
||||
def _ensure_mixer():
|
||||
from config import Config
|
||||
if not pygame.mixer.get_init():
|
||||
pygame.mixer.pre_init(frequency=Config.AUDIO_FREQ,
|
||||
size=Config.AUDIO_SIZE,
|
||||
channels=Config.AUDIO_CHANNELS,
|
||||
buffer=Config.AUDIO_BUFFER)
|
||||
pygame.mixer.init()
|
||||
init_args = {
|
||||
'frequency': Config.AUDIO_FREQ,
|
||||
'size': Config.AUDIO_SIZE,
|
||||
'channels': Config.AUDIO_CHANNELS,
|
||||
'buffer': Config.AUDIO_BUFFER,
|
||||
}
|
||||
if Config.AUDIO_DEVICE:
|
||||
init_args['devicename'] = Config.AUDIO_DEVICE
|
||||
pygame.mixer.init(**init_args)
|
||||
pygame.mixer.set_num_channels(Config.AUDIO_NUM_CHANNELS)
|
||||
|
||||
def _load_sound(file_path):
|
||||
|
||||
Reference in New Issue
Block a user