Skip to content

Player

The playback backend for one voice session, created lazily for a guild’s first queue item and released when the voice leaves.

An operation the backend cannot perform rejects with DisTubeError(UNSUPPORTED); core reports any other rejection as VOICE_FAILED.

Property Type Description
position number Source time, in seconds, of the audio the platform last played, or 0 without a track. A tempo preset changes how fast it advances, not what it measures.

pause(): Promise<void>

Promise<void>


play(resource, options): Promise<Readonly<{ reason: "finished" | "stopped" | "replaced"; }>>

Plays resource unpaused, whatever the previous track’s pause, replacing the current track, which settles replaced first. Settles when the track ends.

Parameter Type
resource PlaybackResource
options TrackOptions

Promise<Readonly<{ reason: "finished" | "stopped" | "replaced"; }>>


release(): Promise<void>

Ends any active track as stopped and releases backend state once. Every call, concurrent, repeated or after the Player closed on its own, settles from that one teardown; later play and controls reject.

Promise<void>


resume(): Promise<void>

Promise<void>


seek(seconds): Promise<void>

Parameter Type
seconds number

Promise<void>


setFilters(entries): Promise<void>

Renders the ordered filter set; an empty list clears it.

Parameter Type
entries readonly FilterEntry[]

Promise<void>


setVolume(percent): Promise<void>

Percentage from 0 to 1000, kept for later tracks.

Parameter Type
percent number

Promise<void>


stopTrack(): Promise<void>

Ends the active track as stopped, leaving the Player usable.

Promise<void>


optional updateVoiceGateway(gateway): Promise<void>

Parameter Type
gateway VoiceGatewayData

Promise<void>