pub struct QualityProfile {
pub bitrate: u32,
pub sample_rate: u32,
pub channels: u8,
pub codec: String,
pub duration: f64,
}Expand description
Audio quality profile with bitrate, sample rate, channels, and codec
Fields§
§bitrate: u32Bitrate in kbps
sample_rate: u32Sample rate in Hz
channels: u8Number of channels (1=mono, 2=stereo)
codec: StringAudio codec (e.g., “mp3”, “aac”)
duration: f64Duration in seconds
Implementations§
Source§impl QualityProfile
impl QualityProfile
Sourcepub fn new(
bitrate: u32,
sample_rate: u32,
channels: u8,
codec: String,
duration: f64,
) -> Result<Self>
pub fn new( bitrate: u32, sample_rate: u32, channels: u8, codec: String, duration: f64, ) -> Result<Self>
Create a new quality profile
Sourcepub fn is_better_than(
&self,
other: &QualityProfile,
prefer_stereo: bool,
) -> bool
pub fn is_better_than( &self, other: &QualityProfile, prefer_stereo: bool, ) -> bool
Compare quality profiles to determine which is better
Sourcepub fn is_compatible_for_concat(&self, other: &QualityProfile) -> bool
pub fn is_compatible_for_concat(&self, other: &QualityProfile) -> bool
Check if two profiles can be concatenated without re-encoding
Sourcepub fn to_aac_equivalent(&self) -> QualityProfile
pub fn to_aac_equivalent(&self) -> QualityProfile
Convert to AAC profile with equivalent or better quality
Sourcepub fn from_preset(
preset: &str,
source: &QualityProfile,
) -> Option<QualityProfile>
pub fn from_preset( preset: &str, source: &QualityProfile, ) -> Option<QualityProfile>
Create a quality profile from a preset Returns None for “source” preset (auto-detect from source files)
Sourcepub fn apply_preset(&self, preset: Option<&str>) -> QualityProfile
pub fn apply_preset(&self, preset: Option<&str>) -> QualityProfile
Apply quality preset override if specified
Trait Implementations§
Source§impl Clone for QualityProfile
impl Clone for QualityProfile
Source§fn clone(&self) -> QualityProfile
fn clone(&self) -> QualityProfile
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 QualityProfile
impl Debug for QualityProfile
Source§impl<'de> Deserialize<'de> for QualityProfile
impl<'de> Deserialize<'de> for QualityProfile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for QualityProfile
impl Display for QualityProfile
Source§impl PartialEq for QualityProfile
impl PartialEq for QualityProfile
Source§impl Serialize for QualityProfile
impl Serialize for QualityProfile
impl StructuralPartialEq for QualityProfile
Auto Trait Implementations§
impl Freeze for QualityProfile
impl RefUnwindSafe for QualityProfile
impl Send for QualityProfile
impl Sync for QualityProfile
impl Unpin for QualityProfile
impl UnwindSafe for QualityProfile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more