Embedded playback
Run the Remedia engine inside your Node.js process.
Embedded mode is the simplest setup. @remedia/client calls the native engine in @remedia/node directly, and no server or WebSocket is involved.
import { Player } from 'discord-player';
const player = new Player({
nodes: [{ id: 'local', type: 'embedded', capacity: 8 }],
send,
});
await player.initialize(botUserId);capacity is how many guild sessions the node accepts. The default is 64.
Set up
- Use Node.js 22.18 or newer with ESM.
- Install
discord-playerand@remedia/node. - Install the FFmpeg 9 shared libraries on the bot machine. The
ffmpegexecutable alone is not enough. - Allow optional platform packages during installation, so the native binary for your platform is installed.
- Run the smoke test.
What embedded nodes allow
Because the engine runs in your process, a source plugin can return a local encoded Readable or a buffer. A remote node cannot use those.
Plan capacity
Each active guild has its own playback and voice session. Size capacity from measured CPU and memory use with your codecs, filters, and crossfade, not from how long queues are.
Shut down cleanly so the native sessions are released:
await player.destroy();Crossfade
Set crossfade on the Player or a queue. Embedded sessions receive the setting directly. See crossfade.
Continue reading
Remote playback