Struct BassChannelOutputStream

Source
pub struct BassChannelOutputStream { /* private fields */ }

Implementations§

Source§

impl BassChannelOutputStream

Source

pub fn new(sample_rate: u32, num_channels: u32) -> Self

创建一个通道输出流。 sample_rate 采样率。 num_channels 声道数量。

Source

pub fn from_memory_file(data: &[u8]) -> Self

从内存文件创建实例。 data 文件数据。

Source

pub fn from_disk_file(path: &str) -> Self

从磁盘文件创建实例。 path 文件路径。

Source

pub fn is_valid(&self) -> bool

判断输出流是否可用。

Source

pub fn dispose(&self)

清理释放。

Source

pub fn play(&self, restart: bool)

播放操作,此方法和start方法的功能一样,但具有从头开始播放的选项。 restart 重新开始。

Source

pub fn pause(&self)

暂停操作。

Source

pub fn stop(&self)

停止操作。

Source

pub fn start(&self)

开始或继续播放操作。

Source

pub fn put_data(&self, data: &[u8]) -> i32

写入数据。 data 音频数据。

Source

pub fn put_file_data(&self, data: &[u8]) -> i32

写入文件数据。 data 音频文件数据。

Source

pub fn set_freq(&self, value: f32)

设置播放频率。 value 要播放的频率。

Source

pub fn is_active(&self) -> i32

检查样本、流或MOD音乐是否处于活动状态(正在播放)或暂停状态。还可以检查是否正在录制。

Source

pub fn is_stopped(&self) -> bool

判断播放状态是否已经停止。

Source

pub async fn wait_until_stopped_or_stalled(&self)

等待直到停止状态或没有数据可以播放。

Source

pub async fn wait_until_paused(&self)

等待直到暂停。

Trait Implementations§

Source§

impl Debug for BassChannelOutputStream

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for BassChannelOutputStream

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for BassChannelOutputStream

Source§

impl Sync for BassChannelOutputStream

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DebugAny for T
where T: Any + Debug,

Source§

impl<T> UnsafeAny for T
where T: Any,