Skip to content

CrossfadeOptions

type CrossfadeOptions = object;

The validated DisTubeOptions.crossfade options of a DisTube instance.

curve: string;

The FFmpeg acrossfade fade curve applied to both sides of the transition.

"qsin" (equal-power)

duration: number;

The default crossfade duration (in seconds) applied to new queues. 0 disables the crossfade. A Queue can override it at runtime through its crossfade property.


preparePrimaryInput?: PrepareCrossfadeInput;

Prepare the fading-out song’s playback input for the crossfade FFmpeg process. It is invoked right before the transition stream is spawned, with the song’s stream url and the position (in seconds, counted from the beginning of the song) where the fade window begins.

Streaming inputs that cannot fast-seek (for example HLS playlists) force FFmpeg to re-download the whole stream and discard everything before the seek position, which can miss the swap window on slow sources. The adapter can return a replacement input that starts near the boundary — a local playlist trimmed to the fade position, for example — along with the seek offset inside it and its own FFmpeg input options. Return null or undefined to use the url as-is.


warmup: number;

How long (in seconds) before the fade window begins the merged transition stream is spawned, so its buffers are warm and the fade starts on time.

5