Function setup_audio_input_loop

Source
pub fn setup_audio_input_loop(
    latest_audio_data: Arc<Mutex<AllocRingBuffer<f32>>>,
    audio_dev_and_cfg: AudioDevAndCfg,
) -> Stream
Expand description

Sets up audio recording with the cpal library on the given audio input device.

If no input device is given, it uses the default input device. Panics, if it not present. Returns the stream plus the chosen config for the device.

Appends all audio data to the ringbuffer latest_audio_data.

Works on Windows (WASAPI), Linux (ALSA) and MacOS (coreaudio).