Skip to main content
VoiceManager manages voice connections per guild. Accessible via client.voice. FluxerVoiceConnection is returned on join and used for audio playback.

VoiceManager

join

Connects to a voice channel. Sends opcode 4 to the Gateway, waits for VOICE_SERVER_UPDATE, then establishes a LiveKit WebRTC connection. If a live connection for the given channel_id already exists, returns it immediately without reconnecting.

disconnect

Closes the connection for the given channel_id and sends opcode 4 with channel_id: null to notify the Gateway.

disconnect_guild

Disconnects all active connections belonging to a guild.

disconnect_all

Disconnects every active voice connection. Errors are silently ignored.

stop_guild

Stops audio playback on all connections in the guild without closing the WebRTC connection.

get_connection

Returns the active connection for a channel, or None if not connected.

is_connected

Returns true if a live connection exists for the given channel_id.

FluxerVoiceConnection

Fields


play_file

Decodes and streams an audio file. Uses symphonia for decoding. The format is detected automatically from the file extension. Publishes an audio track on the first call if not already published.

play_bytes

Decodes and streams audio from a byte buffer. Same decoding pipeline as play_filedata must be a valid encoded audio file (MP3, OGG, WAV, etc.), not raw PCM samples.

stop

Stops the current playback. Does not close the connection — you can call play_file or play_bytes again afterwards.

disconnect

Stops playback and closes the LiveKit room. After this the connection is no longer usable.

is_connected

Returns true if the LiveKit room state is Connected.

VoiceError