Struct discord::voice::VoiceConnection
[−]
[src]
pub struct VoiceConnection { /* fields omitted */ }
An active or inactive voice connection, obtained from Connection::voice
.
Methods
impl VoiceConnection
[src]
fn connect(&mut self, channel_id: ChannelId)
Connect to the specified voice channel. Any previous channel on this server will be disconnected from.
fn disconnect(&mut self)
Disconnect from the current voice channel, if any.
fn set_mute(&mut self, mute: bool)
Set the mute status of the voice connection.
Note that enabling mute client-side is cosmetic and does not prevent the sending of audio; to fully mute, you must manually silence the audio source.
fn set_deaf(&mut self, deaf: bool)
Set the deaf status of the voice connection. Does not affect mute status.
fn current_channel(&self) -> Option<ChannelId>
Get the current channel of this voice connection, if any.
fn play(&mut self, source: Box<AudioSource>)
Play from the given audio source.
fn stop(&mut self)
Stop the currently playing audio source.
fn set_receiver(&mut self, receiver: Box<AudioReceiver>)
Set the receiver to which incoming voice will be sent.
fn clear_receiver(&mut self)
Clear the voice receiver, discarding incoming voice.