【问题标题】:discord.py [mp3 @ 000001dc99bec540] Estimating duration from bitrate, this may be inaccuratediscord.py [mp3 @ 000001dc99bec540] 从比特率估计持续时间,这可能不准确
【发布时间】:2020-09-25 03:13:15
【问题描述】:

我对“[mp3 @ 000001dc99bec540] 从比特率估计持续时间,这可能不准确”有疑问,使用 discord.py。一切正常(机器人正在说出我们告诉他的文本),但最后总是显示出来。我该如何解决?

        if _command == "speak":
            try:
                await message.delete()
                try:
                    error = _message[1]
                except IndexError:
                    message = await _channel.send("Where is my text, which I have to speak?!")
                    await asyncio.sleep(3)
                    await message.delete()
                    return
                channel = message.author.voice.channel
                voice = discord.utils.get(client.voice_clients, guild=_guild)
                if voice and voice.is_connected():
                    await voice.move_to(channel)
                else:
                    voice = await channel.connect()
                tts = gTTS(text=text, lang='en')
                tts.save("pcvoice.mp3")
                voice.play(discord.FFmpegPCMAudio(executable=r"C:\ffmpeg\bin\ffmpeg.exe", source="pcvoice.mp3"))
            except discord.errors.ClientException:
                await _channel.send("Come on! I am already playing something!")

【问题讨论】:

  • 听起来像是开启了 ffmpeg 调试标志。
  • 嗯,你知道如何禁用它吗?

标签: python ffmpeg mp3 discord.py ggts


【解决方案1】:

这是一个完全正常的 FFmpeg 调试打印 一种禁用此功能的方法,虽然可能不是最好的方法

discord.FFmpegPCMAudio(options = "-loglevel panic") 

或任何其他 FFmpeg 认为可接受的日志级别。 这通常很糟糕,因为如果 FFmpeg 失败,您可能想知道。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-12
    • 1970-01-01
    • 1970-01-01
    • 2011-05-28
    • 2016-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多