I have recently been writing a Discord bot recently which plays local mp3 files. The function I've used to play the files looks like this.
conn.play(discord.FFmpegPCMAudio("path/to/file"))
while conn.is_playing():
time.sleep(0.1)
await conn.disconnect()
Now I was thinking about setting up the bot for multiple servers. My problem is that if I want to play two different sounds on two different servers at the same time, the bot is currently only able to play them sequentially and not simultaneously. I thought about having multiple python instances for each server but it looks kind of hard to manage for N server N python instances. It's ok for me to have multiple mp3 files for each server so I don't lock any files. But using multiple python programs looks a bit complicated. Is there any easier solution?