baiumbg / baiumbg-Cogs

A bunch of useless (and some questionably useful) cogs for Red-DiscordBot (V3)
MIT License
3 stars 10 forks source link

[SFX/TTS] Adding SFX or playing tts fails #24

Open DJTOMATO opened 2 years ago

DJTOMATO commented 2 years ago

Adding sfx or playing sounds gives the same error:

!addsfx oof https://cdn.discordapp.com/attachments/861428239012069416/976344074414088212/uuhhh.mp3 !tts es test


Traceback (most recent call last):
  File "redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/cogs/CogManager/cogs/sfx/sfx.py", line 65, in tts
    audio_data = pydub.AudioSegment.from_mp3(audio_file)
  File "/cogs/Downloader/lib/pydub/audio_segment.py", line 796, in from_mp3
    return cls.from_file(file, 'mp3', parameters=parameters)
  File "/cogs/Downloader/lib/pydub/audio_segment.py", line 728, in from_file
    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
  File "/cogs/Downloader/lib/pydub/utils.py", line 279, in mediainfo_json
    info = json.loads(output)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "redenv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: JSONDecodeError: Expecting value: line 1 column 1 (char 0)````