Skip to main content

Module voice

Module voice 

Source
Expand description

Voice channels and music (capability voice, ADR-0020).

The host joins as the bot, end-to-end encrypted like any member, and plays audio for it in real time; the bot only says what to play. Audio is Opus: an https:// Ogg Opus (or, on hosts that demux it, WebM Opus) file or stream the host fetches (under the bot’s network grant, or an http:// server next to the host under its local_network grant), Ogg Opus bytes the bot holds, or Opus packets the bot pushes. Nothing is transcoded.

use zaun_bot::Voice;
Voice::join(channel)?;
Voice::play_url("https://music.example.org/intro.opus", Some("Intro"))?;
Voice::enqueue_url("https://music.example.org/song.opus", Some("Song"))?;

Re-exports§

pub use wit::LoopMode;
pub use wit::PlayerStatus;
pub use wit::VoiceEvent;
pub use wit::VoiceState;

Structs§

Voice
The bot’s voice: one stay at a time.