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. Both ESM
importand CommonJSrequire()are supported. - Install
discord-playerand@remedia/node. - Allow optional platform packages during installation, so the native binary for your OS and CPU architecture is installed.
The official native addon statically links FFmpeg 9. No separate FFmpeg installation or library-path configuration is needed. For addon loading failures, check the original error and native runtime troubleshooting.
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