Skip to main content

Module stream

Module stream 

Source
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_block is being fed.

ConstantsΒ§

I16_SCALE πŸ”’
The scale a full-scale i16 sample 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_block its audio, already mono at SAMPLE_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.