pub struct AudioRequest {
pub sample_rate: Option<u32>,
pub buffer_size: Option<u32>,
}Expand description
What the command line asked for. Both halves optional, and unspecified is the ordinary case.
Separate from EngineConfig because they are different facts: this is a
request, that is what the engine runs at. Collapsing the two is what let an
engine synthesising at 44100 feed a stream running at 48000 — every note
1.47 semitones sharp, 120 BPM playing back at 130.6.
None means follow the device. That is the default because on CoreAudio
pinning a sample rate changes the machine’s nominal rate for every other
application too, and opening a DAW is not consent to that.
Fields§
§sample_rate: Option<u32>Sample rate in Hz, or None to run at whatever the device is set to.
buffer_size: Option<u32>Block size in samples, or None to let the device choose.
Implementations§
Source§impl AudioRequest
impl AudioRequest
Sourcepub const fn follow_device() -> Self
pub const fn follow_device() -> Self
Ask for nothing and take what the device is already doing.
Sourcepub fn without_device(self) -> EngineConfig
pub fn without_device(self) -> EngineConfig
The config to run at when there is no device to follow. Anything the
command line named is honoured; the rest comes from
EngineConfig::default.
Trait Implementations§
Source§impl Clone for AudioRequest
impl Clone for AudioRequest
Source§fn clone(&self) -> AudioRequest
fn clone(&self) -> AudioRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AudioRequest
Source§impl Debug for AudioRequest
impl Debug for AudioRequest
Source§impl Default for AudioRequest
impl Default for AudioRequest
Source§fn default() -> AudioRequest
fn default() -> AudioRequest
impl Eq for AudioRequest
Source§impl From<EngineConfig> for AudioRequest
impl From<EngineConfig> for AudioRequest
Source§fn from(config: EngineConfig) -> Self
fn from(config: EngineConfig) -> Self
“Run at exactly this” as a request. Used by callers that already hold concrete numbers — the headless test apps, which open no device at all.