Repository navigation
cvc::ariadne::stream: composable audio source family — tone / gain / mix - #533
Merged
Merged
Conversation
…mix (f32 PCM) The pure/virtual members of the generalized audio-source family (docs/STREAMING.md; Joe's directive that an audio source be general + composable, not microphone-specific). All are cvc::ariadne::stream::frame_source producing interleaved f32 PCM, so they feed an audio stream like any other frame_source and compose into an audio graph — no SDL, no device, fully testable. inc/cvc/ariadne/stream/audio_sources.h + src/cvc/ariadne/stream/audio_sources.cpp (alongside synthetic_source). - tone_source: a continuous sine (the audio analogue of synthetic_source) with phase carried across chunks; the hardware-free reference source. - gain_source: a FILTER member — wraps one source, scales every sample. - mix_source: the MIX member (an audio multiplexer) — sums N sources sample-wise, clamped to [-1,1]; a spent input contributes silence, the mix stops when all inputs are spent. - audio_f32_bytes(frames, channels) sizes an audio stream's per-chunk bytes. Tests (stream_test AudioSources.*): tone is bounded/seamless (phase carries across chunks); gain scales every sample 2x vs a lockstep reference tone; mix sums two reference tones sample-exact. 31 stream_test tests green. The DEVICE member (SDL mic / any capture device) + the audio-OUTPUT sink (SDL playback) + the Ariadne video/image widget + the example app follow, toward the holy-grail demo.
transfix
force-pushed
the
feat/stream-audio-sources
branch
from
October 2, 2026 06:07
aca1905 to
2590c0d
Compare
transfix
enabled auto-merge
October 2, 2026 06:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The pure / composable members of the audio-source family (toward the holy-grail mic/record/playback demo and your directive that an audio source be general, not microphone-specific). All are
cvc::ariadne::stream::frame_sourceproducing interleaved f32 PCM, so they feed an audio stream like any otherframe_sourceand compose into an audio graph — no SDL, no device, fully testable.tone_source— a continuous sine (the audio analogue ofsynthetic_source), phase carried across chunks; the hardware-free reference source.gain_source— a filter member: wraps one source, scales every sample.mix_source— the mix member (an audio multiplexer): sums N sources sample-wise, clamped to [-1,1]; a spent input contributes silence, the mix stops when all inputs are spent.audio_f32_bytes(frames, channels)sizes an audio stream's per-chunk bytes.In
cvc::ariadne::stream, alongsidesynthetic_source(inc/cvc/ariadne/stream/audio_sources.h+src/cvc/ariadne/stream/audio_sources.cpp).Tests (
stream_testAudioSources.*, fully exercised — no device)Tone is bounded and seamless (phase carries across chunks; pts advances); gain scales every sample 2× vs a lockstep reference tone; mix sums two reference tones sample-exact.
stream_test= 31 green; clang-format clean.Next toward the holy grail
The device member (SDL mic / any capture device, cvcGL) + the audio-output sink (SDL playback, with record/playback) + the Ariadne video/image widget + the example app. Adversarial review (DSP bounds/composition) running; I'll fold findings before auto-merge.