Constructor
new AudioPlayer(guild)
Instantiates a new audio player.
Parameters:
Name | Type | Description |
---|---|---|
guild |
Discord.Guild | Discord guild object. |
- Source:
Members
currentStream
Current stream object
- Source:
ffmpegProcess
FFMPEG process
- Source:
guild
Associated guild
- Source:
timestamp :number
Current playback timestamp.
Type:
- number
- Source:
voiceConnection
Current voice connection
- Source:
Methods
clean(disconnect)
Cleans resources and (optionally) disconnects from the voice channel.
Parameters:
Name | Type | Description |
---|---|---|
disconnect |
boolean | Set to true to disconnect |
- Source:
(async) join(voiceChannel) → {Promise.<Object>}
Joins a voice channel.
Parameters:
Name | Type | Description |
---|---|---|
voiceChannel |
object | Discord voice channel object |
- Source:
Returns:
Discord voice connection object
- Type
- Promise.<Object>
(async) play(voiceChannel, path, flags) → {Promise.<Object>}
Plays an audio stream.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
voiceChannel |
Discord.VoiceChannel | Discordie VoiceChannel object | |||||||||
path |
String | Stream path or URL | |||||||||
flags |
object | Flags to append to the FFMpeg command
Properties
|
- Source:
Returns:
Discord encoder object
- Type
- Promise.<Object>
stop(disconnect, removeEvents)
Attempts to stop playback.
Parameters:
Name | Type | Description |
---|---|---|
disconnect |
boolean | Set to true to also disconnect from the voice channel |
removeEvents |
boolean | Remove event listeners before sending the stream. |
- Source: