class Worker::AudioPlayer

Overview

Single audio player

Defined in:

worker/audio_player.cr
worker/audio_player/asset_audio.cr
worker/audio_player/audio.cr
worker/audio_player/connection_lost_error.cr
worker/audio_player/failed_to_connect_error.cr
worker/audio_player/queue.cr
worker/audio_player/remote_audio.cr

Constant Summary

AUDIO_LOAD_FAILED_TIMEOUT = 3.seconds
AUDIO_PLAY_INTERVAL = 1.second
CONNECTION_CHECK_INTERVAL = 500.milliseconds
CONNECTION_TIMEOUT = 6.seconds
Log = Worker::Log.for("audio_player")
MAXIMUM_SIZE = 2000
PLAY_STOP_AWAIT = 10.seconds
PLAY_STOP_CHECK_INTERVAL = 500.milliseconds
PREMIUM_MAXIMUM_SIZE = 10000

Constructors

Instance Method Summary

Constructor Detail

def self.new(worker : Worker, server_id : UInt64) #

[View source]

Instance Method Detail

def channel_id : UInt64 | Nil #

[View source]
def channel_id=(channel_id : UInt64 | Nil) #

[View source]
def connected? #

[View source]
def connecting? #

[View source]
def current_audio : Audio | Nil #

[View source]
def disconnected? #

[View source]
def disconnecting? #

[View source]
def play(channel_id : UInt64) : Nil #

[View source]
def playing? #

[View source]
def queue : Queue #

[View source]
def skip : Nil #

[View source]
def status : Status #

[View source]
def stop(preserve_current : Bool = false, await_fiber : Bool = false) : Nil #

[View source]