#[repr(i32)]pub enum SampleFormat {
Show 13 variants
None = -1,
U8 = 0,
S16 = 1,
S32 = 2,
Flt = 3,
Dbl = 4,
U8p = 5,
S16p = 6,
S32p = 7,
Fltp = 8,
Dblp = 9,
S64 = 10,
S64p = 11,
}Expand description
Audio sample format, matching FFmpeg’s AVSampleFormat.
Variants§
None = -1
U8 = 0
Unsigned 8 bits.
S16 = 1
Signed 16 bits.
S32 = 2
Signed 32 bits.
Flt = 3
Float.
Dbl = 4
Double.
U8p = 5
Unsigned 8 bits, planar.
S16p = 6
Signed 16 bits, planar.
S32p = 7
Signed 32 bits, planar.
Fltp = 8
Float, planar.
Dblp = 9
Double, planar.
S64 = 10
Signed 64 bits.
S64p = 11
Signed 64 bits, planar.
Implementations§
Source§impl SampleFormat
impl SampleFormat
Sourcepub fn bytes_per_sample(self) -> usize
pub fn bytes_per_sample(self) -> usize
Return the number of bytes per sample.
Sourcepub fn packed(self) -> Self
pub fn packed(self) -> Self
Get the packed equivalent of a planar format (or return self if already packed).
Sourcepub fn planar(self) -> Self
pub fn planar(self) -> Self
Get the planar equivalent of a packed format (or return self if already planar).
pub fn name(self) -> &'static str
Trait Implementations§
Source§impl Clone for SampleFormat
impl Clone for SampleFormat
Source§fn clone(&self) -> SampleFormat
fn clone(&self) -> SampleFormat
Returns a duplicate of the value. Read more
1.0.0 · 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 SampleFormat
impl Debug for SampleFormat
Source§impl Display for SampleFormat
impl Display for SampleFormat
Source§impl Hash for SampleFormat
impl Hash for SampleFormat
Source§impl PartialEq for SampleFormat
impl PartialEq for SampleFormat
impl Copy for SampleFormat
impl Eq for SampleFormat
impl StructuralPartialEq for SampleFormat
Auto Trait Implementations§
impl Freeze for SampleFormat
impl RefUnwindSafe for SampleFormat
impl Send for SampleFormat
impl Sync for SampleFormat
impl Unpin for SampleFormat
impl UnsafeUnpin for SampleFormat
impl UnwindSafe for SampleFormat
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