Skip to content
SinisterRectus edited this page Mar 4, 2017 · 13 revisions

Represents a connection to a Discord voice server.

Class Properties

Name Type Mutable Description
channel GuildVoiceChannel The channel for which the connection exists
isPaused boolean Whether audio is currently paused on the connection
isPlaying boolean Whether audio is currently playing on the connection
playTime number The elapsed play time of the audio stream in milliseconds

Class Methods

Prototype Interface Description
getBitrate() Local Returns the current bitrate for the connection in bits per second.
pauseStream() WS Pauses the current audio stream, if one exists and is playing.
playBytes(string[, duration]) WS Interprets a Lua string as a byte array and streams it.
playFile(filename[, duration]) WS Streams an audio file via FFmpeg.
playPCM(table[, duration]) WS Interprets a Lua table as a PCM array and streams it.
playWaveform(generator[, duration]) WS Streams PCM data returned from a generator function.
resumeStream() WS Resumes the current audio stream, if one exists and is paused.
setBitrate() Local Sets the current bitrate for the connection (8000 to 128000 bps range).
stopStream() WS Stops the current audio stream, if one exists.

Clone this wiki locally