Installation
Install Discord Player and choose where audio runs.
Discord Player v8 requires Node.js 22.18 or newer and ESM.
Starting a new bot?
npm create music-bot@dev my-bot creates a project with everything on this page already installed and configured. See
Getting started. Read on to add Discord Player to an existing project.
pnpm add discord-player@devv8 is a preview release, so install it with the dev tag. Without a tag, your package manager installs v7.
You also need a Discord gateway library such as discord.js. Discord Player does not open the gateway connection itself.
Choose where audio runs
| Embedded | Remote | |
|---|---|---|
| Audio engine | Inside your bot process | A separate remedia-server |
| Extra package on the bot | @remedia/node | None |
| FFmpeg 9 libraries | On the bot machine | On the server machine |
| Local streams from plugins | Supported | Not supported |
| Best for | First bots, single-machine deployments | Scaling, isolating audio from the bot |
Embedded playback
pnpm add @remedia/node@remedia/node must be the exact version that your discord-player release depends on. The generator and the manual setup use 0.1.0, which matches discord-player@dev at the time of writing. Your package manager reports a peer dependency warning when the versions differ.
import { Player } from 'discord-player';
const player = new Player({
nodes: [{ id: 'local', type: 'embedded' }],
send,
});nodes can be omitted. A Player without nodes uses one embedded node named local.
Install the FFmpeg 9 shared libraries on the bot machine. An ffmpeg executable alone is not enough.
Remote playback
import { Player } from 'discord-player';
const player = new Player({
nodes: [
{
id: 'audio-1',
type: 'remote',
url: 'wss://audio.example.com/v1/ws',
auth: { username: 'bot', password: process.env.REMEDIA_PASSWORD! },
},
],
send,
});send is the gateway callback from the manual setup tutorial. The audio server needs FFmpeg and the bot does not. See remote playback for server setup.
Continue reading
Create a music bot