AudioSource

Trait AudioSource 

Source
pub trait AudioSource: DeviceState {
    // Required methods
    fn rate_hz(&self) -> f64;
    fn gain(&self) -> f64;
    fn take_samples(&mut self, mclk: i64) -> Vec<(i32, i32)>;

    // Provided method
    fn applies_gain(&self) -> bool { ... }
}
Expand description

A mixer input with a changeable rate and gain. The PSG is board-owned and first in the list; the CD adds CD-DA (44.1 kHz) and ADPCM (variable).

Required Methods§

Source

fn rate_hz(&self) -> f64

Source

fn gain(&self) -> f64

Source

fn take_samples(&mut self, mclk: i64) -> Vec<(i32, i32)>

Stereo samples produced up to mclk since the last call.

Provided Methods§

Source

fn applies_gain(&self) -> bool

True when the source’s samples already carry its gain (the PSG): the mixer must not apply it a second time.

Implementors§