pub struct CoreAudioDevice { /* private fields */ }Expand description
SIM-visible CoreAudio device metadata.
Implementations§
Source§impl CoreAudioDevice
impl CoreAudioDevice
Sourcepub fn output(
id: impl Into<String>,
name: impl Into<String>,
channels: usize,
timing: CoreAudioTiming,
) -> Result<Self>
pub fn output( id: impl Into<String>, name: impl Into<String>, channels: usize, timing: CoreAudioTiming, ) -> Result<Self>
Builds an output-direction device. See CoreAudioDevice::new.
Sourcepub fn input(
id: impl Into<String>,
name: impl Into<String>,
channels: usize,
timing: CoreAudioTiming,
) -> Result<Self>
pub fn input( id: impl Into<String>, name: impl Into<String>, channels: usize, timing: CoreAudioTiming, ) -> Result<Self>
Builds an input-direction device. See CoreAudioDevice::new.
Sourcepub fn duplex(
id: impl Into<String>,
name: impl Into<String>,
channels: usize,
timing: CoreAudioTiming,
) -> Result<Self>
pub fn duplex( id: impl Into<String>, name: impl Into<String>, channels: usize, timing: CoreAudioTiming, ) -> Result<Self>
Builds a duplex (input and output) device. See CoreAudioDevice::new.
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
direction: HostDirection,
channels: usize,
timing: CoreAudioTiming,
) -> Result<Self>
pub fn new( id: impl Into<String>, name: impl Into<String>, direction: HostDirection, channels: usize, timing: CoreAudioTiming, ) -> Result<Self>
Builds a device from its id, display name, direction, channel count, and timing.
The device starts flagged as neither the default input nor the default
output. Returns an error when channels is zero.
Sourcepub fn with_default_output(self) -> Self
pub fn with_default_output(self) -> Self
Returns this device flagged as the default output device.
Sourcepub fn with_default_input(self) -> Self
pub fn with_default_input(self) -> Self
Returns this device flagged as the default input device.
Sourcepub fn direction(&self) -> HostDirection
pub fn direction(&self) -> HostDirection
Returns the device’s I/O direction.
Sourcepub fn timing(&self) -> CoreAudioTiming
pub fn timing(&self) -> CoreAudioTiming
Returns the device’s timing metadata.
Sourcepub fn default_output(&self) -> bool
pub fn default_output(&self) -> bool
Returns whether this device is flagged as the default output.
Sourcepub fn default_input(&self) -> bool
pub fn default_input(&self) -> bool
Returns whether this device is flagged as the default input.
Sourcepub fn spec(&self) -> Result<PcmSpec>
pub fn spec(&self) -> Result<PcmSpec>
Returns the f32 PCM spec for this device’s channels and sample rate.
Sourcepub fn is_compatible_with(&self, requested: HostDirection) -> bool
pub fn is_compatible_with(&self, requested: HostDirection) -> bool
Returns whether this device can serve a stream in the requested direction.
A duplex device is compatible with any requested direction.
Sourcepub fn port_symbol(&self) -> Symbol
pub fn port_symbol(&self) -> Symbol
Returns the <id>/port symbol naming this device’s host port.
Trait Implementations§
Source§impl Clone for CoreAudioDevice
impl Clone for CoreAudioDevice
Source§fn clone(&self) -> CoreAudioDevice
fn clone(&self) -> CoreAudioDevice
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CoreAudioDevice
impl Debug for CoreAudioDevice
impl Eq for CoreAudioDevice
Source§impl PartialEq for CoreAudioDevice
impl PartialEq for CoreAudioDevice
Source§fn eq(&self, other: &CoreAudioDevice) -> bool
fn eq(&self, other: &CoreAudioDevice) -> bool
self and other values to be equal, and is used by ==.