FIx: More robust opus loading code
This commit is contained in:
parent
eade77ffc3
commit
8ba7906e9f
1 changed files with 10 additions and 5 deletions
|
@ -451,11 +451,16 @@ class Music(Cog):
|
|||
|
||||
logger.info("playing Player on the voice client")
|
||||
self.h += [self.track]
|
||||
if not discord.opus.is_loaded():
|
||||
try:
|
||||
discord.opus.load_opus("/usr/lib/libopus.so")
|
||||
except:
|
||||
logger.error("opus could not be loaded!")
|
||||
while not discord.opus.is_loaded():
|
||||
for path in [
|
||||
"/usr/lib/libopus.so",
|
||||
"/usr/lib/libopus.so.0",
|
||||
]:
|
||||
try:
|
||||
discord.opus.load_opus(path)
|
||||
except:
|
||||
logger.warning(f"opus could not be loaded from {path} -- trying next?")
|
||||
logger.error("opus could not be loaded!")
|
||||
ctx.voice_client.play(
|
||||
player,
|
||||
after=lambda e: self.after(ctx)
|
||||
|
|
Loading…
Reference in a new issue