hex/src/microphone_activity
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dax c852079cad
windows meetings: loop back only the call app's outputs (#1605)
* windows: hear only the call app's outputs during meetings

A virtual mixer (SteelSeries Sonar, VB-Cable, Voicemeeter) has a playback
endpoint that carries the user's processed microphone, and replays the call
on the physical output. Looping back every render endpoint therefore
recorded the user's own voice, and the remote voices twice.

A meeting started for a call app now loops back the endpoints where the
app's microphone holder also plays, else any endpoint one of its processes
plays on, and falls back to every output only when the app has no session
or its outputs would not open. A manual recording still hears every output.
The selection is a pure function in meeting/loopback_route.rs, tested on
every platform; the Windows adapter maps cpal devices to WASAPI endpoint
ids. The route check recomputes every 2 s, compares endpoint ids, and
keeps the current outputs while the app's sessions are temporarily absent
or the enumeration fails.

* windows meetings: keep the loopback outputs a blip would flip-flop

The 2 s route check reopened whenever the computed app set differed from
the open one, so the seconds the call app's microphone-holder session was
missing moved it to the fallback set, and the holder's return moved it
back, reopening the system track each way. should_reopen in
meeting/loopback_route.rs keeps the current outputs when the new app set
still covers them (equal or a superset, as the fallback of a second
process is), and still reopens on a changed microphone-holder set or app
outputs that leave out a current endpoint.

A detected call app that has no playback session yet, or whose sessions
can't be read, is heard through every output until the 2 s check finds the
app's outputs; when none of the app's outputs open, Hex hears every
output and stops following the app for that source. docs/features/meetings.md
says both, with the current test names.

The CoInitializeEx SAFETY comment now covers a thread already in another
apartment (S_FALSE or RPC_E_CHANGED_MODE, both fine since the calls need
no message pump), the GetId comment covers the CoTaskMemAlloc string read
and freed once, and process_path is private again.

* windows meetings: reopen when an app's own outputs grow
2026-11-09 16:43:46 -05:00
..
linux.rs Fold microphone_activity_* into microphone_activity/ 2026-10-31 15:13:56 -07:00
windows.rs windows meetings: loop back only the call app's outputs (#1605) 2026-11-09 16:43:46 -05:00