audio_input.h
Live audio input for the standalone build.
#include <sonore/audio_input.h>- 1type
- 2other declarations
- Guides: Platforms and formats
On this page
Design notes
The output backend's own header carried the admission: "live microphone input is a later feature, not a missing piece of this one." It was a missing piece. An effect standalone that cannot be fed a live signal is a guitar pedal with no jack: you can render files through it and you can audition its test tone, and you cannot play through it, which is the one thing anybody wants to do with a distortion.
The shape is the same on every platform and it is the shape the problem has, not a preference:
Capture runs on its OWN clock, on its own thread, woken by its own device. Render runs on another. They are never the same clock even when they claim the same rate, so the only correct thing between them is a ring the capture side fills and the render side drains.
What this does NOT do is hide the consequence. Two free-running clocks drift, and a ring absorbs drift until it doesn't; when it doesn't, either the reader finds nothing or the writer finds no room. Both are counted and both are reported. A backend that silently papered over them would be a backend whose glitches have no name.
Types 1
No comment on this one in the header yet; the source says the rest.
Aliases 2
- using
using AudioRing = sonore::AudioRingThe SPSC ring, which now lives in audio_ring.h so a recorder can use it without dragging a capture backend in with it. The name here is what every caller in this file has always written.standalone::AudioRing · audio_input.h:40 - using
using PlatformAudioInput = NullAudioInputstandalone::PlatformAudioInput · audio_input.h:103