From 1d2969189e24a7056ff511d13b22441c4dc61b8a Mon Sep 17 00:00:00 2001 From: Headshotnoby Date: Tue, 22 Jun 2021 12:13:15 -0400 Subject: [PATCH] don't import pybass or load dll twice --- audio.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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)