#[non_exhaustive]pub enum CoreEvent {
SpeakingStateUpdate,
VoiceTick,
RtpPacket,
RtcpPacket,
ClientDisconnect,
DriverConnect,
DriverReconnect,
DriverDisconnect,
}
Expand description
Voice core events occur on receipt of voice packets and telemetry.
Core events persist while the action
in EventData
returns None
.
§Events from other users
Songbird can observe when a user speaks for the first time (SpeakingStateUpdate
),
when a client leaves the session (ClientDisconnect
).
When the "receive"
feature is enabled, songbird can also handle voice packets
(RtpPacket
),
decode and track speaking users
(VoiceTick
),
and handle telemetry data
(RtcpPacket
).
The format of voice packets is described by
VoiceData
.
To detect when a user connects, you must correlate gateway (e.g., VoiceStateUpdate
) events
from the main part of your bot.
To obtain a user’s SSRC, you must use SpeakingStateUpdate
events.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SpeakingStateUpdate
Speaking state update from the WS gateway, typically describing how another voice user is transmitting audio data. Clients must send at least one such packet to allow SSRC/UserID matching.
Fired on receipt of a speaking state update from another host.
Note: this will fire when a user starts speaking for the first time, or changes their capabilities.
VoiceTick
Fires every 20ms, containing the scheduled voice packet and decoded audio data for each live user.
RtpPacket
Fires on receipt of a voice packet from another stream in the voice call.
As RTP packets do not map to Discord’s notion of users, SSRCs must be mapped back using the user IDs seen through client connection, disconnection, or speaking state update.
RtcpPacket
Fires on receipt of an RTCP packet, containing various call stats such as latency reports.
ClientDisconnect
Fires whenever a user disconnects from the same stream as the bot.
DriverConnect
Fires when this driver successfully connects to a voice channel.
DriverReconnect
Fires when this driver successfully reconnects after a network error.
DriverDisconnect
Fires when this driver fails to connect to, or drops from, a voice channel.
Trait Implementations§
Source§impl From<CoreEvent> for UntimedEvent
impl From<CoreEvent> for UntimedEvent
impl Copy for CoreEvent
impl Eq for CoreEvent
impl StructuralPartialEq for CoreEvent
Auto Trait Implementations§
impl Freeze for CoreEvent
impl RefUnwindSafe for CoreEvent
impl Send for CoreEvent
impl Sync for CoreEvent
impl Unpin for CoreEvent
impl UnwindSafe for CoreEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more