Skip to content

Commit

Permalink
Update opus_loader.py
Browse files Browse the repository at this point in the history
  • Loading branch information
infinitepower18 authored Oct 17, 2019
1 parent 29c18c3 commit eedbee3
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions musicbot/opus_loader.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
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 eedbee3

Please sign in to comment.