Skip to content

Commit

Permalink
Events: Document format of VoiceData. (#114)
Browse files Browse the repository at this point in the history
Closes #100.
  • Loading branch information
FelixMcFelix authored Feb 14, 2022
1 parent 16acfd4 commit 806a422
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/events/context/data/voice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ use super::*;
/// Opus audio packet, received from another stream (detailed in `packet`).
/// `payload_offset` contains the true payload location within the raw packet's `payload()`,
/// if extensions or raw packet data are required.
/// If `audio.len() == 0`, then this packet arrived out-of-order.
///
/// Valid audio data (`Some(audio)` where `audio.len >= 0`) contains up to 20ms of 16-bit mono PCM audio
/// at 48kHz, using native endianness. Songbird will not send audio for silent regions, these should
/// be inferred using [`SpeakingUpdate`]s (and filled in by the user if required using arrays of zeroes).
///
/// If `audio.len() == 0`, then this packet arrived out-of-order. If `None`, songbird was not configured
/// to decode received packets.
///
/// [`SpeakingUpdate`]: crate::events::CoreEvent::SpeakingUpdate
pub struct VoiceData<'a> {
/// Decoded audio from this packet.
pub audio: &'a Option<Vec<i16>>,
Expand Down

0 comments on commit 806a422

Please sign in to comment.