pub struct CpalSource { /* private fields */ }Expand description
Captures from the default input device of a cpal host (ALSA on Linux, which PipeWire and PulseAudio serve; AAudio on Android).
The stream is built as f32, or as i16 when the device offers nothing else; the capture function always sees f32. The i16
path keeps a scratch buffer that grows to the largest block seen, so it allocates on the first callbacks only.
Implementations§
Trait Implementations§
Source§impl AudioSource for CpalSource
impl AudioSource for CpalSource
Source§fn default_config(&self) -> Result<SinkConfig, SinkError>
fn default_config(&self) -> Result<SinkConfig, SinkError>
The device’s preferred configuration.
Source§fn start(
&mut self,
config: SinkConfig,
capture: CaptureFn,
) -> Result<SinkHandle, SinkError>
fn start( &mut self, config: SinkConfig, capture: CaptureFn, ) -> Result<SinkHandle, SinkError>
Start capturing with exactly
config, calling capture with each block. Capture stops when the handle is dropped.Auto Trait Implementations§
impl Forget for CpalSource
impl Freeze for CpalSource
impl Move for CpalSource
impl RefUnwindSafe for CpalSource
impl Send for CpalSource
impl Sync for CpalSource
impl Unpin for CpalSource
impl UnsafeUnpin for CpalSourcewhere
*const ArcInner<AlsaContext> is !null: UnsafeUnpin,
PhantomData<ArcInner<AlsaContext>>: UnsafeUnpin,
impl UnwindSafe for CpalSourcewhere
Arc<AlsaContext>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more