Discord Player

StreamDispatcher

No description provided

StreamDispatcher extends EventEmitter<VoiceEvents>

Properties

public audioPlayer: any

public audioResource: any

public channel: any

public connectionTimeout: any

public dsp: any

public queue: any

public voiceConnection: any

public static defaultMaxListeners: any

public biquad: any

public equalizer: any

public filters: any

public paused: any

Check if the player has been paused manually

public resampler: any

public status: any

The player status

public streamTime: any

The playback time

public volume: any

The current volume

Methods

public addListener(event, listener): this

ParameterTypeOptional
eventU
listenerVoiceEvents[U]

public createStream(src, ops?): Promise<AudioResource<Track<unknown>>>

Creates stream

ParameterTypeOptionalDescription
srcReadableThe stream source
opsCreateStreamOpsOptions

public destroy(): void

Destroys this dispatcher

public disconnect(): void

Disconnects from voice

public emit(event, args): boolean

ParameterTypeOptional
eventU
argsParameters<VoiceEvents[U]>

public end(): void

Stops the player

public eventNames(): Array<U>

public getMaxListeners(): number

public isBuffering(): boolean

Whether or not the player is currently buffering

public isConnecting(): boolean

Whether or not the voice connection is connecting

public isDestroyed(): boolean

Whether or not the voice connection has been destroyed

public isDisconnected(): boolean

Whether or not the voice connection has been destroyed

public isIdle(): boolean

Whether or not the player is currently idle

public isPaused(): boolean

Whether or not the player is currently paused automatically or manually.

public isPlaying(): boolean

Whether or not the player is currently playing

public isReady(): boolean

Whether or not the voice connection is ready to play

public isSignalling(): boolean

Whether or not the voice connection is signalling

public listenerCount(type): number

ParameterTypeOptional
typekeyof VoiceEvents

public listeners(type): Array<VoiceEvents[U]>

ParameterTypeOptional
typeU

public off(event, listener): this

ParameterTypeOptional
eventU
listenerVoiceEvents[U]

public on(event, listener): this

ParameterTypeOptional
eventU
listenerVoiceEvents[U]

public once(event, listener): this

ParameterTypeOptional
eventU
listenerVoiceEvents[U]

public pause(interpolateSilence?): boolean

Pauses the stream playback

ParameterTypeOptionalDescription
interpolateSilencebooleanIf true, the player will play 5 packets of silence after pausing to prevent audio glitches.

public playStream(resource?): Promise<undefined | StreamDispatcher>

Play stream

ParameterTypeOptionalDescription
resourceAudioResource<Track<unknown>>The audio resource to play

public prependListener(event, listener): this

ParameterTypeOptional
eventU
listenerVoiceEvents[U]

public prependOnceListener(event, listener): this

ParameterTypeOptional
eventU
listenerVoiceEvents[U]

public rawListeners(type): Array<VoiceEvents[U]>

ParameterTypeOptional
typeU

public removeAllListeners(event?): this

ParameterTypeOptional
eventkeyof VoiceEvents

public removeListener(event, listener): this

ParameterTypeOptional
eventU
listenerVoiceEvents[U]

public resume(): boolean

Resumes the stream playback

public setMaxListeners(n): this

ParameterTypeOptional
nnumber

public setVolume(value): boolean

Sets playback volume

ParameterTypeOptionalDescription
valuenumberThe volume amount

On this page

StreamDispatcher extends EventEmitter<VoiceEvents>Propertiespublic audioPlayer: anypublic audioResource: anypublic channel: anypublic connectionTimeout: anypublic dsp: anypublic queue: anypublic voiceConnection: anypublic static defaultMaxListeners: anypublic biquad: anypublic equalizer: anypublic filters: anypublic paused: anypublic resampler: anypublic status: anypublic streamTime: anypublic volume: anyMethodspublic addListener(event, listener): thispublic createStream(src, ops?): Promise<AudioResource<Track<unknown>>>public destroy(): voidpublic disconnect(): voidpublic emit(event, args): booleanpublic end(): voidpublic eventNames(): Array<U>public getMaxListeners(): numberpublic isBuffering(): booleanpublic isConnecting(): booleanpublic isDestroyed(): booleanpublic isDisconnected(): booleanpublic isIdle(): booleanpublic isPaused(): booleanpublic isPlaying(): booleanpublic isReady(): booleanpublic isSignalling(): booleanpublic listenerCount(type): numberpublic listeners(type): Array<VoiceEvents[U]>public off(event, listener): thispublic on(event, listener): thispublic once(event, listener): thispublic pause(interpolateSilence?): booleanpublic playStream(resource?): Promise<undefined | StreamDispatcher>public prependListener(event, listener): thispublic prependOnceListener(event, listener): thispublic rawListeners(type): Array<VoiceEvents[U]>public removeAllListeners(event?): thispublic removeListener(event, listener): thispublic resume(): booleanpublic setMaxListeners(n): thispublic setVolume(value): boolean