【问题标题】:discord.errors.ClientException: C:/ffmpeg/bin/ffmpeg was not founddiscord.errors.ClientException:找不到 C:/ffmpeg/bin/ffmpeg
【发布时间】:2021-02-13 19:13:20
【问题描述】:

我正在尝试为我的不和谐创建一个音乐机器人。我现在想要的只是让我的不和谐机器人播放音乐剪辑。我根本没有找到任何解决方案。

@commands.command()
async def play(self, ctx, url):
    channel = ctx.author.voice.channel
    channel = await channel.connect()
    guild = ctx.guild
    voice_client: discord.VoiceClient = discord.utils.get(self.bot.voice_clients, guild=guild)
    audio_source = discord.FFmpegPCMAudio(executable="C:/ffmpeg/bin/ffmpeg", source="alex_sus.mp3")
    if not voice_client.is_playing():
        voice_client.play(audio_source, after=None)

这正是我的代码,但我得到了错误:

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: C:/ffmpeg/bin/ffmpeg was not found.

该文件绝对位于我指定的位置,并且我将 ffmpeg 放入了我的 env 路径。我在安装 ffmpeg 时遵循了每条指令,但我所做的一切都不起作用。我只想注意 ffmpeg 在我的 C 盘上,而代码在我的 D 盘上。我知道这是否会有所作为。

【问题讨论】:

    标签: ffmpeg discord.py discord.py-rewrite


    【解决方案1】:

    在 Windows 上,您需要添加文件扩展名。默认情况下,您的 Windows 文件资源管理器可能会隐藏扩展名。

    executable="C:/ffmpeg/bin/ffmpeg.exe"
    

    【讨论】:

      猜你喜欢
      • 2012-10-25
      • 1970-01-01
      • 2022-08-23
      • 2020-12-05
      • 2021-10-27
      • 1970-01-01
      • 2019-08-12
      • 2011-03-13
      • 2015-04-12
      相关资源
      最近更新 更多