Python: FFmpeg Input/output error using discord.py
here is my code:
async def direct(self, interaction: discord.Interaction, link: str):
voice_client = get(self.bot.voice_clients, guild=interaction.guild)
if voice_client is None:
return await interaction.response.send_message("❌ Connect to a channel first.")
await interaction.response.send_message("Using direct link.")
voice_client.play(discord.FFmpegPCMAudio(link))
return
here is my error:
[tls @ 0x557c73a19d00] Error in the pull function.
https://cdn.discordapp.com/attachments/1109998398150545410/1112473248505004142/portradio-_1_.ogg: Input/output error
2023-05-28 13:29:11 INFO discord.player ffmpeg process 1458408 successfully terminated with return code of 0.
this happens usually around half-way through whatever im playing consistently
i’ve tried setting arguments like:
ffmpeg_options = {'options': '-vn -dn -sn -ignore_unknown -fflags +discardcorrupt'}
from this other post
‘corrupt input packet in stream 1’ error in FFMPEG
which fixed the error corrupt input packet but im still having trouble any ideas?
goal is to get the audio playing to discord without having to store the file locally then playing it from there then discarding it after.
Read more here: Source link