voelin-ui: pick and mix the quick share's sound as the studio does
The "Share screen" dialog had one switch for sound, "Share system audio", which shared whatever stream.audio_sources held: changing what the stream carries (an application, the microphone, desktop audio without Voelin) or how loud meant the Stream Studio or the settings, and a running share never followed. The dialog now shows the studio's audio mixer while the switch is on (off still means no audio at all): the studio's MixerRow for each source (meter, gain, mute, the menu) and Add, which opens the studio's PickDialog over the dialog to switch several sources on and off. They read the main window's StudioBridge, filled without starting the studio (App::mixer_show). Starting a share hands the sources with their gain and mute to the capture (CaptureRequest::audio_sources); the stream announces sound only when there is some. While it runs, the dialog shows the same rows with the share mixer's meters, about 15 times a second (the share keeps the timer), and every change of stream.audio_sources, from the dialog or anywhere else (the settings change event), goes to the running capture at once through Capture::follow_audio, which reconfigures the streamer. A share started without sound has no audio track, so the dialog says so instead. The studio's rows and meters follow whichever streamer goes out: a quick share's while one runs, else the studio's encoder. The picker's application list is let go once neither the dialog nor the studio needs it. With sample data, VOELIN_OPEN=share:live shares the test pattern with the sample studio's sources, live at once with sample viewers, and Stop ends it, as the studio's demo does. On a phone the frame-rate and bitrate fields of the dialog no longer run past its edge. Tests: capture_request carries the picked sources with gain and mute, and nothing with the switch off or no sources; a running capture on the test pattern follows changed sources, keeps a silent track when all are removed, and one started without sound stays so. Headless screenshots of the dialog before and during a share, 1440x900 and 390x844. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1c6251e7b7
commit
318850fcd8
14 files changed
+410
-59
No files matched your search
+8
-3
@@ -234,9 +234,13 @@ The audio of our stream is a mix of any number of sources
|
||||
`[{"kind": "desktop"}, {"kind": "app", "name": "firefox", "gain": 0.5},
|
||||
{"kind": "microphone", "muted": true}]`. Other kinds are `"window"` and
|
||||
`"synthetic"` (`frequency`), and an app can be given by `"pid"`. The
|
||||
default is desktop audio; `[]` shares without sound. The desktop app
|
||||
reads it when sharing starts (`media::audio_source_specs`).
|
||||
`media::audio_apps()` lists the applications for a picker.
|
||||
default is desktop audio; `[]` shares without sound. The app's share
|
||||
dialog and the Stream Studio pick and mix the sources with the same
|
||||
mixer rows and picker ([ui.md](ui.md#sound-in-the-quick-share)); a share
|
||||
hands them to its capture when it starts (`media::audio_source_specs`),
|
||||
and a running share or studio follows every change of the key through
|
||||
`Streamer::reconfigure`. `media::audio_apps()` lists the applications
|
||||
for a picker.
|
||||
|
||||
What applications play is captured by `capture::playback::start_playback`:
|
||||
|
||||
@@ -979,6 +983,7 @@ has not run on Windows yet.
|
||||
| Stream mixer (latency, fade on underrun, drift correction, rate conversion, limiter, levels, live source changes), `BlockClock` | `voelin-media` `mix::tests`, `tests/mix_alloc.rs` (no allocation per block) | tested |
|
||||
| Application audio on PipeWire: desktop without our own stream, by name, by pid, a new player linked live, a quit one dropped, a restarted one matched again, the app list | `voelin-media/tests/pipewire_apps.rs` (private PipeWire, WirePlumber and D-Bus; tones told apart by frequency) | tested with PipeWire 1.0 and WirePlumber 0.4; skipped without them |
|
||||
| Streamer audio sources (mix levels, gain, mute, live change, microphone tap, window source error, silence) | `voelin-core` `media::tests::audio_sources_change_live`, `audio_sources_from_settings`, `settings::tests::audio_sources` | tested |
|
||||
| The share dialog's audio: the picked sources (gain, mute) in the capture request, none with "Share system audio" off; a running share following `stream.audio_sources` (a share without sound left so) | `voelin-ui` `streams::tests::the_share_carries_the_picked_audio`, `video::tests::a_share_follows_its_audio_sources`; headless screenshots (`share`, `share:live`) | tested; the dialog itself only in headless screenshots (nothing clicked) |
|
||||
| X11 `_NET_WM_PID` of the shared window | `tests/x11_capture.rs` under Xvfb (`VOELIN_X11_TEST_DISPLAY`) | tested |
|
||||
| WASAPI per-process loopback, audio sessions, `HWND` owner | – | type-checked for `x86_64-pc-windows-gnu` only |
|
||||
| Android per-app and all-but-ours playback capture | `cargo ndk -t arm64-v8a clippy`, `gradlew compileDebugKotlin` | compiles only (no device or emulator here) |
|
||||
|
||||
Reference in new issue
Block a user