pub struct AudioFormat {
pub sample_rate: u32,
pub channels: u16,
}Expand description
The wire format of an AudioChunk: its sample rate and channel count.
Samples are always f32; only the rate and channel count vary along the
pipeline (capture ~48 kHz → STT 16 kHz → TTS 24 kHz → playback ~48 kHz),
which is why every chunk carries its own format instead of assuming one.
Fields§
§sample_rate: u32Samples per second, per channel (e.g. 48 000 for 48 kHz).
channels: u16Number of channels (1 = mono, 2 = stereo). Samples are interleaved.
Implementations§
Trait Implementations§
Source§impl Clone for AudioFormat
impl Clone for AudioFormat
Source§fn clone(&self) -> AudioFormat
fn clone(&self) -> AudioFormat
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 moreimpl Copy for AudioFormat
Source§impl Debug for AudioFormat
impl Debug for AudioFormat
impl Eq for AudioFormat
Source§impl PartialEq for AudioFormat
impl PartialEq for AudioFormat
impl StructuralPartialEq for AudioFormat
Auto Trait Implementations§
impl Freeze for AudioFormat
impl RefUnwindSafe for AudioFormat
impl Send for AudioFormat
impl Sync for AudioFormat
impl Unpin for AudioFormat
impl UnsafeUnpin for AudioFormat
impl UnwindSafe for AudioFormat
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