Skip to content

Commit

Permalink
fix load_opus_lib()
Browse files Browse the repository at this point in the history
originally by @amit177
  • Loading branch information
srhinos committed Oct 17, 2019
1 parent fede432 commit 20741ff
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions musicbot/opus_loader.py
@@ -1,17 +1,13 @@
from discord import opus

OPUS_LIBS = ['libopus-0.x86.dll', 'libopus-0.x64.dll', 'libopus-0.dll', 'libopus.so.0', 'libopus.0.dylib']


def load_opus_lib(opus_libs=OPUS_LIBS):
def load_opus_lib():
if opus.is_loaded():
return True
return

for opus_lib in opus_libs:
try:
opus.load_opus(opus_lib)
return
except OSError:
pass
try:
opus._load_default()
return
except OSError:
pass

raise RuntimeError('Could not load an opus lib. Tried %s' % (', '.join(opus_libs)))
raise RuntimeError('Could not load an opus lib.')

0 comments on commit 20741ff

Please sign in to comment.