跳到主要内容

AudioSettingsBuilder

搜索

Struct AudioSettingsBuilder 

源代码
pub struct AudioSettingsBuilder { /* private fields */ }
展开描述

用于配置音频编码器设置的构建器。

实现§

源代码§

impl AudioSettingsBuilder

源代码

pub const fn new() -> Self

使用通用默认值构造一个新的 AudioSettingsBuilder

默认值:

  • 比特率:192 kbps
  • 声道数:2
  • 采样率:48 kHz
  • 每个样本的位数:16
  • Subtype: AudioSettingsSubType::AAC
  • 已禁用:false
源代码

pub const fn bitrate(self, bitrate: u32) -> Self

设置音频比特率(单位:比特/秒)。

源代码

pub const fn channel_count(self, channel_count: 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 sub_type(self, sub_type: AudioSettingsSubType) -> Self

设置音频编解码器/子类型(例如 AudioSettingsSubType::AAC)。

源代码

pub const fn disabled(self, disabled: bool) -> Self

禁用或启用音频编码。

Trait 实现§

源代码§

impl Default for AudioSettingsBuilder

源代码§

fn default() -> Self

Returns the “default value” for a type. 阅读更多

自动 Trait 实现§

通用实现§

源代码§

impl<T> Any for T
where T: 'static + ?Sized,

源代码§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
源代码§

impl<T> Borrow<T> for T
where T: ?Sized,

源代码§

fn borrow(&self) -> &T

从拥有的值不可变地借用。阅读更多
源代码§

impl<T> BorrowMut<T> for T
where T: ?Sized,

源代码§

fn borrow_mut(&mut self) -> &mut T

从拥有的值可变地借用。阅读更多
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回参数。

源代码§

impl<T, U> Into<U> for T
where U: From<T>,

源代码§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换由 From<T> for U 的实现决定。

源代码§

impl<T> IntoEither for T

源代码§

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>
where F: FnOnce(&Self) -> bool,

self 转换为 Left 变体,如果 Either<Self, Self>into_left(&self) returns true. Converts self into a Right 变体,如果 Either<Self, Self> 否则。 阅读更多
源代码§

impl<T> Pointable for T

源代码§

const ALIGN: usize

指针的对齐方式。
源代码§

type Init = T

初始化器的类型。
源代码§

unsafe fn init(init: <T as Pointable>::Init) -> usize

使用给定的初始化器初始化 a。阅读更多
源代码§

unsafe fn deref<'a>(ptr: usize) -> &'a T

解引用给定的指针。阅读更多
源代码§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

可变地解引用给定的指针。阅读更多
源代码§

unsafe fn drop(ptr: usize)

释放在给定指针处指向的对象。阅读更多
源代码§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

源代码§

type Error = Infallible

转换失败时返回的类型。
源代码§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行此转换。
源代码§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

源代码§

type Error = <U as TryFrom<T>>::Error

转换失败时返回的类型。
源代码§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行此转换。