why is the FFmpegPCMAudio not playing?

Viewed 20

in the following code of a discod bot (wrote in python) the FFmpegPCMAudio is not playing, the code and the mp3 audio are in the same folder, also, yesterday the bot worked well, but today when i write the command the bot enters the voice chat, but it doesn't play the mp3 audio, why?


import discord as ds
from discord.ext import commands
from discord import FFmpegPCMAudio


    
intents = ds.Intents.all()
bot = commands.Bot(command_prefix='$', intents = intents)

@bot.event
async def on_ready():
    print('bot online.')

@bot.command(pass_context = True)
async def outro(ctx):
    if (ctx.author.voice):
        channel = ctx.message.author.voice.channel
        voce = await channel.connect()
        source = FFmpegPCMAudio('outro.mp3')
        player = voce.play(source)
        
    else:
        await ctx.send('not in a voice chat')

@bot.command(pass_context = True)
async def esci(ctx):
    if (ctx.voice_client):
        await ctx.guild.voice_client.disconnect()
        await ctx.send('adios @everyone')
    else:
        ctx.send('not in a voice chat')



bot.get_command('outro')
bot.get_command('esci')



bot.run('MTAwNDA0MjQ1MjcxMTI0NzkwNQ.GjUNFS.LecuRh7QuWxrdpK-lqyH3npMUzCiIyzehCQfjU')
1 Answers

If you're running this on Replit, it's because Replit no longer supports ffmpeg. If not, then you don't have it installed properly on your system.

Related