pub struct AudioFrame(/* private fields */);
Expand description
An audio frame. Thin wrapper around GenericFrame
. Like a frame but has specific audio properties.
Implementations§
Source§impl AudioFrame
impl AudioFrame
Sourcepub fn channel_layout(&self) -> AudioChannelLayout
pub fn channel_layout(&self) -> AudioChannelLayout
Returns the channel layout of the frame.
Sourcepub const fn channel_count(&self) -> usize
pub const fn channel_count(&self) -> usize
Returns the channel count of the frame.
Sourcepub const fn nb_samples(&self) -> i32
pub const fn nb_samples(&self) -> i32
Returns the number of samples in the frame.
Sourcepub const fn sample_rate(&self) -> i32
pub const fn sample_rate(&self) -> i32
Returns the sample rate of the frame.
Sourcepub const fn set_sample_rate(&mut self, sample_rate: usize)
pub const fn set_sample_rate(&mut self, sample_rate: usize)
Sets the sample rate of the frame.
Sourcepub fn data(&self, index: usize) -> Option<&[u8]>
pub fn data(&self, index: usize) -> Option<&[u8]>
Returns a reference to the data of the frame. By specifying the index of the plane.
Sourcepub fn data_mut(&mut self, index: usize) -> Option<&mut [u8]>
pub fn data_mut(&mut self, index: usize) -> Option<&mut [u8]>
Returns a mutable reference to the data of the frame. By specifying the index of the plane.
Sourcepub const fn format(&self) -> AVSampleFormat
pub const fn format(&self) -> AVSampleFormat
Get the sample format of the frame.
Sourcepub fn builder() -> AudioFrameBuilder
pub fn builder() -> AudioFrameBuilder
Creates a new AudioFrame
Methods from Deref<Target = GenericFrame>§
Sourcepub fn pts(&self) -> Option<i64>
pub fn pts(&self) -> Option<i64>
Returns the presentation timestamp of the frame, in time_base
units.
Sourcepub fn set_pts(&mut self, pts: Option<i64>)
pub fn set_pts(&mut self, pts: Option<i64>)
Sets the presentation timestamp of the frame, in time_base
units.
Sourcepub fn set_duration(&mut self, duration: Option<i64>)
pub fn set_duration(&mut self, duration: Option<i64>)
Sets the duration of the frame, in time_base
units.
Sourcepub fn best_effort_timestamp(&self) -> Option<i64>
pub fn best_effort_timestamp(&self) -> Option<i64>
Returns the best effort timestamp of the frame, in time_base
units.
Sourcepub fn dts(&self) -> Option<i64>
pub fn dts(&self) -> Option<i64>
Returns the decoding timestamp of the frame, in time_base
units.
Sourcepub fn set_time_base(&mut self, time_base: impl Into<Rational>)
pub fn set_time_base(&mut self, time_base: impl Into<Rational>)
Sets the time base of the frame.
Trait Implementations§
Source§impl Clone for AudioFrame
impl Clone for AudioFrame
Source§fn clone(&self) -> AudioFrame
fn clone(&self) -> AudioFrame
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more