'Discord Bot Not Playing Sound - Discord.py

I'm trying to add sound functionality to my bot, but I'm having an issue getting the sound to play. I'm not getting any errors in my console, so I'm not sure what the problem is. If I print(sound) I get None, so I'm thinking the issue is that there is no sound, but I'm wondering why is that.

UPDATE: I added voice.is_playing() to check whether audio is playing and it returns true but no audio is emitted.

@commands.command()
async def play(self, ctx, url : str):
voice_state = ctx.author.voice
channel = ctx.author.voice.channel
voice_channel = discord.utils.get(ctx.guild.voice_channels, name = str(channel))

if voice_state is None:
    return await ctx.send("Enter voice channel")
await voice_channel.connect()
voice = discord.utils.get(self.client.voice_clients, guild = ctx.guild)
song_there = os.path.isfile("song.mp3")
try:
    if song_there:
        os.remove("song.mp3")
except PermissionError: 
    await ctx.send("Wait for song to end")

ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192'
    }]
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([url])
for file in os.listdir("./"):
    if file.endswith('.mp3'):
        os.rename(file, 'song.mp3')

sound = voice.play(discord.FFmpegPCMAudio("song.mp3"))
print(sound) #returns none


Solution 1:[1]

make sure you have ffmpeg installed and make sure it can connect

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 codingwithrage