pub struct AudioSettingsBuilder { /* private fields */ }展开描述
用于配置音频编码器设置的构建器。
Implementations§
源代码§impl AudioSettingsBuilder
impl AudioSettingsBuilder
源代码pub const fn new() -> Self
pub const fn new() -> Self
使用通用默认值构造一个新的 AudioSettingsBuilder。
默认值:
- 比特率:192 kbps
- 声道数:2
- 采样率:48 kHz
- 每个样本的位数:16
- Subtype:
AudioSettingsSubType::AAC - 已禁用:false
源代码pub const fn channel_count(self, channel_count: u32) -> Self
pub const fn channel_count(self, channel_count: u32) -> Self
设置交错声道数。
源代码pub const fn sample_rate(self, sample_rate: u32) -> Self
pub const fn sample_rate(self, sample_rate: u32) -> Self
设置采样率(单位:Hz)。
源代码pub const fn bit_per_sample(self, bit_per_sample: u32) -> Self
pub const fn bit_per_sample(self, bit_per_sample: u32) -> Self
设置每个样本的位数。
源代码pub const fn sub_type(self, sub_type: AudioSettingsSubType) -> Self
pub const fn sub_type(self, sub_type: AudioSettingsSubType) -> Self
设置音频编解码器/子类型(例如 AudioSettingsSubType::AAC)。
Trait 实现§
自动 Trait 实现§
impl Freeze for AudioSettingsBuilder
impl RefUnwindSafe for AudioSettingsBuilder
impl Send for AudioSettingsBuilder
impl Sync for AudioSettingsBuilder
impl Unpin for AudioSettingsBuilder
impl UnsafeUnpin for AudioSettingsBuilder
impl UnwindSafe for AudioSettingsBuilder
通用实现§
源代码§impl<T> IntoEither for T
impl<T> IntoEither for T
源代码§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
将
self 转换为 Left 变体,如果 Either<Self, Self>
当 into_left is true.
Converts self into a Right 变体,如果 Either<Self, Self>
否则。 阅读更多源代码§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
将
self 转换为 Left 变体,如果 Either<Self, Self>
当 into_left(&self) returns true.
Converts self into a Right 变体,如果 Either<Self, Self>
否则。 阅读更多