forked from helionmusic/rhinobot_heroku
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29c18c3
commit eedbee3
Showing
1 changed file
with
9 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.') | ||
|