Skip to main content

AudioStream

Struct AudioStream 

Source
pub struct AudioStream;

Implementations§

Source§

impl AudioStream

Source

pub fn start(sample_rate: u32, channels: u32)

連続再生を始める(既に同じ形式で動いていれば何もしない)。

Source

pub fn push(pcm: &[i16])

復号済みの PCM(交互配置)を足す。

Source

pub fn buffered_ms() -> u64

溜まっている時間 [ms](連続再生していなければ 0)。

Source

pub fn set_paused(paused: bool)

一時停止(無音を流し、待ち行列は保つ)・再開。

Source

pub fn flush()

待ち行列を捨てる(シーク時)。

Source

pub fn is_active() -> bool

Source

pub fn stop()

連続再生を止め、PWM を効果音(単音)用の設定へ戻す。

Source

fn delay()

Source

unsafe fn hw_start(range: u32)

PWM のクロック(PLLD/2)・周期・FIFO・DREQ を設定し、DMA のリングを始める。

Source

unsafe fn fill_half(half: usize)

面 half(0/1)を待ち行列から埋め、DMA から見えるようにキャッシュを書き出す。

Source

fn feeder_thread()

補給スレッド: DMA が読み終えた面を埋め直す(QEMU では実時間で消費するだけ)。

Source

unsafe fn restore_tone_mode()

PWM を init() と同じ効果音(単音)用の設定へ戻す(OSC 19.2MHz / 16、M/S 方式)。

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> Same for T

Source§

type Output = T

Should always be Self
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.