StreamDispatcher extends EventEmitter<VoiceEvents>
new StreamDispatcher(connection, channel, queue, connectionTimeout)
Parameter | Type | Optional | Description |
---|---|---|---|
connection | VoiceConnection | β | The connection |
channel | StageChannel | VoiceChannel | β | The connected channel |
queue | GuildQueue<unknown> | β | - |
connectionTimeout | number | β | - |
Properties
public audioPlayer: AudioPlayer
public audioResource: null | AudioResource<Track>
public channel: StageChannel | VoiceChannel
public connectionTimeout: number
public dsp: FiltersChain
public queue: GuildQueue<unknown>
private readyLock: boolean
public receiver: VoiceReceiverNode
public voiceConnection: VoiceConnection
public static defaultMaxListeners: number
- Source:
packages/utils/dist/index.d.ts#L42
public biquad: null | BiquadStream
public equalizer: null | EqualizerStream
public filters: null | AudioFilter
public paused: boolean
Check if the player has been paused manually
public resampler: null | PCMResampler
public status: AudioPlayerStatus
The player status
public streamTime: number
The playback time
public volume: number
The current volume
Methods
public addListener(event, listener): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
listener | VoiceEvents[U] | β | - |
- Source:
packages/utils/dist/index.d.ts#L44
public createStream(src, ops?): Promise<AudioResource<Track>>
Creates stream
Parameter | Type | Optional | Description |
---|---|---|---|
src | Readable | β | The stream source |
ops | CreateStreamOps | β | Options |
public disconnect(): void
Disconnects from voice
public emit(event, args): boolean
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
args | Parameters<VoiceEvents[U]> | β | - |
- Source:
packages/utils/dist/index.d.ts#L52
public end(): void
Stops the player
public eventNames(): Array<U>
- Source:
packages/utils/dist/index.d.ts#L53
public getMaxListeners(): number
- Source:
packages/utils/dist/index.d.ts#L57
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
Parameter | Type | Optional | Description |
---|---|---|---|
type | keyof VoiceEvents | β | - |
- Source:
packages/utils/dist/index.d.ts#L54
public listeners(type): Array<VoiceEvents[U]>
Parameter | Type | Optional | Description |
---|---|---|---|
type | U | β | - |
- Source:
packages/utils/dist/index.d.ts#L55
public off(event, listener): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
listener | VoiceEvents[U] | β | - |
- Source:
packages/utils/dist/index.d.ts#L51
public on(event, listener): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
listener | VoiceEvents[U] | β | - |
- Source:
packages/utils/dist/index.d.ts#L50
public once(event, listener): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
listener | VoiceEvents[U] | β | - |
- Source:
packages/utils/dist/index.d.ts#L49
public pause(interpolateSilence?): boolean
Pauses the stream playback
Parameter | Type | Optional | Description |
---|---|---|---|
interpolateSilence | boolean | β | If true, the player will play 5 packets of silence after pausing to prevent audio glitches. |
public playStream(resource?): Promise<undefined | StreamDispatcher>
Play stream
Parameter | Type | Optional | Description |
---|---|---|---|
resource | AudioResource<Track> | β | The audio resource to play |
public prependListener(event, listener): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
listener | VoiceEvents[U] | β | - |
- Source:
packages/utils/dist/index.d.ts#L45
public prependOnceListener(event, listener): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
listener | VoiceEvents[U] | β | - |
- Source:
packages/utils/dist/index.d.ts#L46
public rawListeners(type): Array<VoiceEvents[U]>
Parameter | Type | Optional | Description |
---|---|---|---|
type | U | β | - |
- Source:
packages/utils/dist/index.d.ts#L56
public removeAllListeners(event?): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | keyof VoiceEvents | β | - |
- Source:
packages/utils/dist/index.d.ts#L48
public removeListener(event, listener): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
event | U | β | - |
listener | VoiceEvents[U] | β | - |
- Source:
packages/utils/dist/index.d.ts#L47
public resume(): boolean
Resumes the stream playback
public setMaxListeners(n): StreamDispatcher
Parameter | Type | Optional | Description |
---|---|---|---|
n | number | β | - |
- Source:
packages/utils/dist/index.d.ts#L58
public setVolume(value): boolean
Sets playback volume
Parameter | Type | Optional | Description |
---|---|---|---|
value | number | β | The volume amount |