I have a discord bot writte in discord js. I have one command that plays a mp3 file in a voice channel.
const connection = await channel.join();
const dispatcher = connection.playStream(fs.createReadStream('/absolute/path/to/file.mp3'), { type: 'ogg/opus', volume: true });
If i run the bot on my windows pc, everything works fine. The bot joins the channel, plays the file and leaves again. If i run the bot on my Ubuntu 18.04 VM though, the bot joins and immideatly disconnects without playing the file.
The path to the mp3 file is absolute. I have already tried using connection.playFile(path) instead with the same problem. I tried using opusscript and i tried using node-opus. I have ffmpeg installed via apt. Node and npm are running on the latest version. I also tried using the master branch of discord.js with still no luck. I tried deleting everything and reinstallling it again, it still didn't work.