class Worker::DiscordClient::AsyncVoiceClient

Overview

Discord voice client facade

Defined in:

worker/discord_client/async_voice_client.cr

Constant Summary

CONNECTION_CHECK_INTERVAL = 200.milliseconds
CONNECTION_TIMEOUT = 4.seconds
IDEAL_INTERVAL = 20.milliseconds
Log = Worker::Log.for("discord_async_voice_client")

Constructors

Instance Method Summary

Instance methods inherited from class Worker::DiscordClient::VoiceClient

current_frame : UInt64 current_frame, on_close(&) : Nil on_close, play(audio : AudioPlayer::Audio, skip_frames : UInt64 = 0_u64) : Nil play, stop : Nil stop, voice_server_update(endpoint : String, token : String, session_id : String) : Nil voice_server_update

Constructor Detail

def self.new(server_id : UInt64, bot_id : UInt64, endpoint : String, token : String, session_id : String) #

[View source]

Instance Method Detail

def current_frame : UInt64 #
Description copied from class Worker::DiscordClient::VoiceClient

Returns current frame (originally 'frame' is 20 ms of playback)


[View source]
def on_close(&on_close : -> ) : Nil #
Description copied from class Worker::DiscordClient::VoiceClient

Setup WS close event listener


[View source]
def play(audio : AudioPlayer::Audio, skip_frames : UInt64 = 0_u64) : Nil #
Description copied from class Worker::DiscordClient::VoiceClient

Play single track


[View source]
def stop : Nil #
Description copied from class Worker::DiscordClient::VoiceClient

Stop playback


[View source]
def voice_server_update(endpoint : String, token : String, session_id : String) : Nil #
Description copied from class Worker::DiscordClient::VoiceClient

VSU event handler


[View source]