EDA.Voice.Session (EDA v0.3.0)

Copy Markdown View Source

WebSocket connection to a Discord Voice Gateway (one per guild).

Uses v8 of the voice gateway protocol. On 4006 (session invalid), triggers a full restart (leave + rejoin) to obtain fresh credentials.

Summary

Functions

Sends a payload to the voice gateway.

Starts a voice gateway WebSocket connection.

Enables continuous audio receiving for the given guild. Incoming voice packets will be dispatched as VOICE_AUDIO events.

Disables continuous audio receiving for the given guild.

Returns the registry-based name for a voice session.

Types

t()

@type t() :: %EDA.Voice.Session{
  channel_id: term(),
  connected_clients: term(),
  dave_manager: term(),
  encryption_mode: term(),
  endpoint: term(),
  guild_id: term(),
  heartbeat_ack: term(),
  heartbeat_interval: term(),
  heartbeat_ref: term(),
  ip: term(),
  listening: term(),
  port: term(),
  ready: term(),
  secret_key: term(),
  seq_ack: term(),
  session_id: term(),
  ssrc: term(),
  ssrc_map: term(),
  token: term(),
  udp_socket: term()
}

Functions

send_payload(guild_id, payload)

Sends a payload to the voice gateway.

start_link(opts)

Starts a voice gateway WebSocket connection.

start_listening(guild_id)

Enables continuous audio receiving for the given guild. Incoming voice packets will be dispatched as VOICE_AUDIO events.

stop_listening(guild_id)

Disables continuous audio receiving for the given guild.

via(guild_id)

Returns the registry-based name for a voice session.