pub struct CoreAudioBackend { /* private fields */ }Expand description
CoreAudio host backend with provider-supplied deterministic devices.
Implementations§
Source§impl CoreAudioBackend
impl CoreAudioBackend
Sourcepub fn new(devices: Vec<CoreAudioDevice>) -> Self
pub fn new(devices: Vec<CoreAudioDevice>) -> Self
Builds a backend over the given provider-supplied devices.
The advertised capabilities are derived from the device directions, and the backend reports itself as a hardware (non-fake) backend.
Sourcepub fn fake() -> Self
pub fn fake() -> Self
Builds a deterministic offline backend with a fake default output and default input device.
The backend reports the Offline and Fake capabilities so it can be
exercised in tests without Apple frameworks or audio hardware.
Sourcepub fn list_devices(&self) -> &[CoreAudioDevice]
pub fn list_devices(&self) -> &[CoreAudioDevice]
Returns the devices known to this backend.
Sourcepub fn default_output(&self) -> Option<&CoreAudioDevice>
pub fn default_output(&self) -> Option<&CoreAudioDevice>
Returns the first device flagged as the default output, if any.
Sourcepub fn default_input(&self) -> Option<&CoreAudioDevice>
pub fn default_input(&self) -> Option<&CoreAudioDevice>
Returns the first device flagged as the default input, if any.
Sourcepub fn open_default_output(&self, capacity: usize) -> Result<HostOpenStream>
pub fn open_default_output(&self, capacity: usize) -> Result<HostOpenStream>
Opens an output stream on the default output device.
capacity bounds the open request’s buffer policy. Returns an error if
no default output device is present.
Sourcepub fn open_default_input(&self, capacity: usize) -> Result<HostOpenStream>
pub fn open_default_input(&self, capacity: usize) -> Result<HostOpenStream>
Opens an input stream on the default input device.
capacity bounds the open request’s buffer policy. Returns an error if
no default input device is present.
Trait Implementations§
Source§impl Clone for CoreAudioBackend
impl Clone for CoreAudioBackend
Source§fn clone(&self) -> CoreAudioBackend
fn clone(&self) -> CoreAudioBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more