pub struct AudioStreamInfo { /* private fields */ }Expand description
Information about an audio stream within a media file.
This struct contains all metadata needed to understand and process an audio stream, including sample rate, channel layout, and codec information.
§Construction
Use AudioStreamInfo::builder() for fluent construction:
use ff_format::stream::AudioStreamInfo;
use ff_format::SampleFormat;
use ff_format::codec::AudioCodec;
let info = AudioStreamInfo::builder()
.index(1)
.codec(AudioCodec::Aac)
.sample_rate(48000)
.channels(2)
.build();Implementations§
Source§impl AudioStreamInfo
impl AudioStreamInfo
Sourcepub fn builder() -> AudioStreamInfoBuilder
pub fn builder() -> AudioStreamInfoBuilder
Creates a new builder for constructing AudioStreamInfo.
§Examples
use ff_format::stream::AudioStreamInfo;
use ff_format::codec::AudioCodec;
use ff_format::SampleFormat;
let info = AudioStreamInfo::builder()
.index(1)
.codec(AudioCodec::Aac)
.sample_rate(48000)
.channels(2)
.build();Sourcepub const fn codec(&self) -> AudioCodec
pub const fn codec(&self) -> AudioCodec
Returns the audio codec.
Sourcepub fn codec_name(&self) -> &str
pub fn codec_name(&self) -> &str
Returns the codec name as reported by the demuxer.
Sourcepub const fn sample_rate(&self) -> u32
pub const fn sample_rate(&self) -> u32
Returns the sample rate in Hz.
Sourcepub const fn channel_layout(&self) -> ChannelLayout
pub const fn channel_layout(&self) -> ChannelLayout
Returns the channel layout.
Sourcepub const fn sample_format(&self) -> SampleFormat
pub const fn sample_format(&self) -> SampleFormat
Returns the sample format.
Sourcepub const fn is_surround(&self) -> bool
pub const fn is_surround(&self) -> bool
Returns true if this is a surround sound stream (more than 2 channels).
Trait Implementations§
Source§impl Clone for AudioStreamInfo
impl Clone for AudioStreamInfo
Source§fn clone(&self) -> AudioStreamInfo
fn clone(&self) -> AudioStreamInfo
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 AudioStreamInfo
impl Debug for AudioStreamInfo
Auto Trait Implementations§
impl Freeze for AudioStreamInfo
impl RefUnwindSafe for AudioStreamInfo
impl Send for AudioStreamInfo
impl Sync for AudioStreamInfo
impl Unpin for AudioStreamInfo
impl UnsafeUnpin for AudioStreamInfo
impl UnwindSafe for AudioStreamInfo
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