Files
VoelinClient/tools
Claude 2c655048c0 voelin-core: stream audio mixed from any number of sources
The streamer captured one audio source (system audio, or a tone with the
test pattern), so viewers also heard the voices we play back, and there
was no choice of what to share.

StreamerConfig::audio_sources now takes any number of AudioSourceSpec
(kind, gain, mute): DesktopWithoutSelf, App(name or pid), WindowAudio
(the shared window's process, on X11 and Windows), Microphone (after
noise suppression, through the voelin-audio tap) and Synthetic. They feed
a StreamMixer whose thread encodes one Opus frame every 20 ms on the
monotonic clock, stamped with the block number, so the RTP time follows
real time across silences and stalls. Mixing goes on without a sink, so
source buffers keep moving.

StreamerConfigUpdate::audio_sources changes them live: kinds that stay
keep their capture and take the new gain and mute, new ones start,
removed ones stop, and an empty list leaves a silent track. A source that
cannot capture does not fail the stream; its error shows in
StreamerStats::audio_sources (with level, state, latency and underruns),
and in Streamer::audio_error, which now returns an owned String.
StreamerStats also carries the mix level and the limiter gain;
Streamer::audio_mixer gives the handle for lock-free meters, and
media::audio_apps lists the applications for a picker.

The settings key stream.audio_sources (JSON, default: desktop audio
without Voelin) stores the sources. The UI's share reads it, and an
empty list shares without sound. StreamAudio is boxed so a LocalPreview
held inline stays small.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 12:49:52 +00:00
..