pub struct DecodedAudio {
pub pcm: Vec<i16>,
pub channels: u8,
pub sample_rate_hz: u32,
pub frame_outcomes: Vec<FrameOutcome>,
}Expand description
Decoded audio for one Opus packet: interleaved 48 kHz PCM plus the per-frame outcomes.
Fields§
§pcm: Vec<i16>Interleaved signed 16-bit PCM at 48 kHz. For stereo the layout is
[L0, R0, L1, R1, …]; for mono it is [S0, S1, …]. Length is
total_samples_per_channel * channels.
channels: u8Number of audio channels (1 for mono, 2 for stereo).
sample_rate_hz: u32Output sample rate in Hz (always OUTPUT_SAMPLE_RATE_HZ).
frame_outcomes: Vec<FrameOutcome>Per-Opus-frame outcomes, in packet order. outcomes.len() equals
the packet’s §3.2 frame count.
Implementations§
Source§impl DecodedAudio
impl DecodedAudio
Sourcepub fn samples_per_channel(&self) -> usize
pub fn samples_per_channel(&self) -> usize
Total per-channel 48 kHz sample count across every Opus frame in the packet.
Trait Implementations§
Source§impl Clone for DecodedAudio
impl Clone for DecodedAudio
Source§fn clone(&self) -> DecodedAudio
fn clone(&self) -> DecodedAudio
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DecodedAudio
impl Debug for DecodedAudio
Source§impl PartialEq for DecodedAudio
impl PartialEq for DecodedAudio
Source§fn eq(&self, other: &DecodedAudio) -> bool
fn eq(&self, other: &DecodedAudio) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DecodedAudio
Auto Trait Implementations§
impl Freeze for DecodedAudio
impl RefUnwindSafe for DecodedAudio
impl Send for DecodedAudio
impl Sync for DecodedAudio
impl Unpin for DecodedAudio
impl UnsafeUnpin for DecodedAudio
impl UnwindSafe for DecodedAudio
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
Mutably borrows from an owned value. Read more