0

I'm working on the BOT industry for Dyscord and I need to play a voice clip in a kinetic knowledge I have a 32-bit computer

import discord
from discord.ext import commands
import os
client = commands.Bot(command_prefix="!")
@client.command()
async def play(ctx, url : str):
    print('We have logged in as {0.user}'.format(client))
    voiceChannel = discord.utils.get(ctx.guild.voice_channels, name="Lounge")
    await voiceChannel.connect()
    voice = discord.utils.get(client.voice_clients, guild=ctx.guild)

    voice.play(discord.FFmpegPCMAudio("song.mp3"))

@client.command()
async def ext(ctx):
    voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
    await voice.disconnect()

client.run('token')


  • What have you [tried](https://meta.stackoverflow.com/q/261592/3929826) so far? – Klaus D. Nov 29 '21 at 20:15
  • Does this answer your question? [Convert audio files to mp3 using ffmpeg](https://stackoverflow.com/questions/3255674/convert-audio-files-to-mp3-using-ffmpeg) – RoseGod Nov 29 '21 at 20:57

1 Answers1

-1

Heyo! I recommend checking out this GitHub repo: https://github.com/pariweshsubedi/python-ffmpeg-audio-converter

It'll help make things easier.

spinfal
  • 64
  • 6