Voice 14: apps/fluxer voice runtime wiring (#75) #131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "voice-14-app-voice-runtime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: voice-10-core-soundboard
What this builds
apps/fluxer/src/voice_rt.rs:VoiceBackend(room + sound system;new(room, host),paced_null(room, NullHost, NullControl)) andVoiceRuntime, which spawns theVoiceSession, forwardsVoiceEvent->CoreEvent::Voice, pumpsremote_audio()->AudioEngine::push_remote, and executesEffect::Voice.UnavailableRoomis used for real instances until the LiveKit room (Voice 13) lands: every join fails with a reason the voice panel shows.apps/fluxer/src/audio_rt.rs: executes everyAudioCommandon theAudioEngine(CaptureConfig->ChainConfig,DeviceId"default" ->None,PlaybackSource->SourceId, chimes at the output volume).StartCapturestarts a thread that feeds the engine's processed frames toVoiceHandle::push_microphone.EngineEvent->AudioEvent, withLevelThrottleholding local/remote levels to 20 Hz each (the newest one waits). It also holds the downloaded sound bytes forPlayClip, and a pacer that advances aNullHostclock in real time.runtime.rs:Runtime::with_voice_backend.FetchMediaskips the download whenAudioEngine::has_clip. Leaving the room stops the clips and drops the bytes nobody took. The status API (fluxer-status-api) starts disabled with the runtime (port 21863, or a free port with--devserver), follows the "Companion apps" switch and token, and getsselectors::voice_status(&app)after everyapply.Handle::status_api_addr(), plusHandle::voice_script()with--devserver. In devserver mode the default backend isFakeRoom+ pacedNullHost. The room follows the scenario's voice script: speakers are added with a microphone track and set as active speakers, and leavers are removed.config.rs:--audio-null.record.rs:e2ee_keyis redacted (Review Focus 7).How it was tested
apps/fluxer/tests/voice_runtime.rsruns against thevoicedevserver scenario with aFakeRoomand a pacedNullHost:join_reaches_connected_and_mic_frames_reach_roomremote_tone_reaches_mixer_with_user_gain: peak at 50 % = 8192 x 10^-0.6 +/- 15 %deafen_stops_remote_audio: unsubscribed, mic muted, silencesoundboard_event_plays_clipstatus_api_reports_connected_channel: a raw GET/statusrecord_mode_never_contains_token_or_e2ee_keyleaving_stops_captureThere are also unit tests for the level throttle, the chain mapping, the default device,
UnavailableRoomande2ee_keyredaction.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis green locally, and clippy passes with--no-default-features.Deviations
Apmstage:fluxer-audiohas no echo canceller or AGC (spec §12 Q3).echo_cancellationandauto_gainare ignored.PlayClip, and the engine's 32-clip decoded cache covers repeats.UnavailableRoom.lib.rswas touched to declare and export the new modules.README.mdwas updated.Closes #75
🤖 Generated with Claude Code
Independent review: Voice 14 (app-voice-runtime)
Reviewed only
add3ec1..origin/voice-14-app-voice-runtime(e0e3168).Tests (plan Step 1): all 7 named tests are in
apps/fluxer/tests/voice_runtime.rsand assert what the plan asks for. The user-gain check uses 10^-0.6 for 50 %, matching the original curve. Deafen asserts that the track is unsubscribed (Review Focus 1), that the mic is muted, and that nothing is played.Interfaces: Effect::Voice and Effect::Audio are executed. The pipeline is capture → CaptureChain → push_microphone, then remote_audio → push_remote. Levels are throttled to 20 Hz and coalesced (with unit tests).
StatusApi::publish(voice_status)runs after every apply.--devserveruses FakeRoom and a paced NullHost.--audio-nullis added.Invariants: no core/ui crate touched, no secrets in fixtures, no new third-party dependency (
bytesis already in the workspace). The session token,e2ee_keyand status token are all secrets and are never logged.Findings
record_mode_never_contains_token_or_e2ee_key, thee2ee_keyassert is vacuous because the devserver voice scenario never sends ane2ee_key. Review Focus 7 is still covered by the new unit testvoice_server_update_loses_its_token_and_e2ee_keyin record.rs. Nothing checks the status-API token against logs; it is only ever passed around as aSecretString.audio_rt::Media, bytes fetched for aPlayClipthat never arrives stay in memory until the room is left. There is no disk cache, which is a documented deviation from the plan. The bound is one entry per clip key.FetchMediaskips the download whenengine.has_clip. If the engine evicts that clip beforePlayClip, the sound is skipped. ClipFinished is still emitted, so the store does not hang.UnavailableRoomuntil Voice 13 lands. lib.rs was touched to export the new modules. Make sure a follow-up issue tracks the Apm stage.CI
Local
cargo xtask ciin a clean review worktree: green (exit 0). All 7 voice_runtime tests passed.Verdict: APPROVE (no blocking findings).