Extends
- WritableStream
Members
(readonly) bitrateEditable :boolean
Whether or not the Opus bitrate of this stream is editable
Type:
- boolean
(nullable) broadcast :VoiceBroadcast
The broadcast controlling this dispatcher, if any
Type:
(readonly) paused :boolean
Whether or not playback is paused
Type:
- boolean
(nullable) pausedSince :number
The time that the stream was paused at (null if not paused)
Type:
- number
(readonly) pausedTime :number
Total time that this dispatcher has been paused in milliseconds
Type:
- number
player :AudioPlayer
The Audio Player that controls this dispatcher
Type:
(readonly) streamTime :number
The time (in milliseconds) that the dispatcher has actually been playing audio for
Type:
- number
(readonly) totalStreamTime :number
The time (in milliseconds) that the dispatcher has been playing audio for, taking into account skips and pauses
Type:
- number
(readonly) volume :number
The current volume of the stream
Type:
- number
- Implements:
- Source:
(readonly) volumeDecibels :number
The current volume of the stream in decibels
Type:
- number
- Implements:
- Source:
(readonly) volumeEditable :boolean
Whether or not the volume of this stream is editable
Type:
- boolean
- Implements:
- Source:
(readonly) volumeLogarithmic :number
The current volume of the stream from a logarithmic scale
Type:
- number
- Implements:
- Source:
Methods
pause(silenceopt)
Pauses playback
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
silence |
boolean |
<optional> |
false | Whether to play silence while paused to prevent audio glitches |
resume()
Resumes playback
setBitrate(value) → {boolean}
Set the bitrate of the current Opus encoder if using a compatible Opus stream.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | New bitrate, in kbps If set to 'auto', the voice channel's bitrate will be used |
Returns:
true if the bitrate has been successfully changed.
- Type
- boolean
setFEC(enabled) → {boolean}
Enables or disables forward error correction if using a compatible Opus stream.
Parameters:
Name | Type | Description |
---|---|---|
enabled |
boolean | true to enable |
Returns:
Returns true if it was successfully set.
- Type
- boolean
setPLP(value) → {boolean}
Sets the expected packet loss percentage if using a compatible Opus stream.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | between 0 and 1 |
Returns:
Returns true if it was successfully set.
- Type
- boolean
setVolume(volume)
Sets the volume relative to the input stream - i.e. 1 is normal, 0.5 is half, 2 is double.
Parameters:
Name | Type | Description |
---|---|---|
volume |
number | The volume that you want to set |
- Implements:
- Source:
setVolumeDecibels(db)
Sets the volume in decibels.
Parameters:
Name | Type | Description |
---|---|---|
db |
number | The decibels |
- Implements:
- Source:
setVolumeLogarithmic(value)
Sets the volume so that a perceived value of 0.5 is half the perceived volume etc.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value for the volume |
- Implements:
- Source:
Events
debug
Emitted whenever the dispatcher has debug information.
Parameters:
Name | Type | Description |
---|---|---|
info |
string | The debug info |
error
Emitted when the dispatcher encounters an error.
speaking
Emitted when the dispatcher starts/stops speaking.
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | Whether or not the dispatcher is speaking |
start
Emitted once the stream has started to play.
volumeChange
Emitted when the volume of this dispatcher changes.
Parameters:
Name | Type | Description |
---|---|---|
oldVolume |
number | The old volume of this dispatcher |
newVolume |
number | The new volume of this dispatcher |
- Implements:
- Source: