Constructor
new SharedStream()
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
current |
Object
|
<nullable> |
The current stream |
ended |
Boolean
|
Whether the stream ended |
|
playing |
Boolean
|
Whether the voice connection is playing something |
|
speaking |
Boolean
|
Whether someone is speaking |
|
volume |
Number
|
The current volume level of the connection |
- Source:
Extends
- EventEmitter
Methods
add(connection)
Add a voice connection to the shared stream
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
VoiceConnection
|
The voice connection to add |
play(resource, optionsopt)
Play an audio or video resource. If playing from a non-opus resource, FFMPEG should be compiled with --enable-libopus for best performance. If playing from HTTPS, FFMPEG must be compiled with --enable-openssl
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resource |
ReadableStream
|
String
|
The audio or video resource, either a ReadableStream, URL, or file path |
||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
<optional> |
Music options
|
remove(connection)
Remove a voice connection from the shared stream
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
VoiceConnection
|
The voice connection to remove |
setVolume(volume)
Sets the volume of this shared stream if inline volume is enabled
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
volume |
Number
|
The volume as a value from 0 (min) to 1 (max) |
Events
error
Fired when the shared stream encounters an error
Properties:
| Name | Type | Description |
|---|---|---|
e |
Error
|
The error |
- Source: