diff --git a/audio.py b/audio.py index cc54ed6..c3bcd50 100644 --- a/audio.py +++ b/audio.py @@ -36,13 +36,13 @@ def init(freq=48000): Initialize BASS and the opus plugin """ global dll, use_ctypes - if platform.system() == "Darwin": - dll = ctypes.CDLL(dllf) - use_ctypes = True - else: - import pybass as dll + if not dll: + if platform.system() == "Darwin": + dll = ctypes.CDLL(dllf) + use_ctypes = True + else: + import pybass as dll - dll.BASS_Free() dll.BASS_Init(ini.read_ini_int("AO2XP.ini", "Audio", "device", -1), freq, 0, 0, 0) dll.BASS_PluginLoad(os.path.abspath(opus), 0)