Handles UDP socket management, IP discovery, audio encoding via FFmpeg, and the player loop for sending opus frames over RTP.
Summary
Functions
Receives count voice packets from the UDP socket.
Opens a UDP socket and performs IP discovery against the voice server.
Starts playing audio from the given input. Runs as a linked process.
Functions
Receives count voice packets from the UDP socket.
Returns a list of {ssrc, opus_data} tuples.
@spec open_udp_and_discover(String.t(), integer(), integer()) :: {:ok, port(), String.t(), integer()} | {:error, term()}
Opens a UDP socket and performs IP discovery against the voice server.
Returns {:ok, socket, our_ip, our_port} or {:error, reason}.
Starts playing audio from the given input. Runs as a linked process.
Types:
:url- URL or file path passed to ffmpeg:raw- Raw opus frames (binary stream)
Returns the pid of the player process.