Expand description
Opening a device and reading its audio as it arrives.
Re-exportsΒ§
use std::sync::Arc;πuse std::sync::atomic::AtomicBool;πuse std::sync::atomic::Ordering;πuse std::time::Duration;πuse cpal::traits::DeviceTrait;πuse cpal::traits::StreamTrait;πuse crate::Error;πuse crate::SAMPLE_RATE;πuse crate::convert::InputConverter;πuse crate::device::Device;πuse crate::device::InputFormat;πuse crate::device::describe;πuse crate::device::input_config;πuse crate::device::open_device;π
StructsΒ§
- Block
- One block of the deviceβs audio, as it arrived.
- Capture
- A live capture: the device is open and
on_blockis being fed.
ConstantsΒ§
- I16_
SCALE π - The scale a full-scale
i16sample maps to, in the f32 the pipeline reads. - PANIC_
SITE π - The backtrace a panic hook took on this thread.
FunctionsΒ§
- guard_
block π - Run one audio-callback block with its panic caught.
- i16_
sample π - One device sample as the f32 the pipeline reads.
- open
- Open the named input (or the system default) and feed
on_blockits audio, already mono atSAMPLE_RATE, until the capture is stopped. - record_
panic_ πsites - Install the hook that records a panicβs OWN backtrace.
- take_
panic_ πsite - The backtrace this threadβs panic hook took, if it took one.