feat(sender): streaming audio controls — volume key relay and local auto-mute#138
Open
lionheo9 wants to merge 1 commit into
Open
feat(sender): streaming audio controls — volume key relay and local auto-mute#138lionheo9 wants to merge 1 commit into
lionheo9 wants to merge 1 commit into
Conversation
…uto-mute ScreenCaptureKit captures system audio upstream of the output device, so streamed audio doubled onto the local speakers, and once muted by hand the hardware volume keys only flashed the local mute bezel — receiver volume was adjustable solely from the app. Two changes make streaming audio behave like a real output device: - The local default output mutes automatically while a session streams with audio and restores when the last one stops. Only a mute the app applied itself is undone; a pre-existing mute or a manual unmute mid-stream stands. - A consuming NX_SYSDEFINED event tap redirects sound-up/down/mute to the connected sessions' stream volume (1/16 steps, 1/64 with shift+option, mute toggles and restores), which the receiver applies to its own system volume with its HUD. Keys pass through untouched when nothing streams audio or the settings toggle is off. Requires Accessibility trust; the settings pane shows a hint while it is missing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
ScreenCaptureKit captures system audio upstream of the output device, so streamed audio always doubled onto the sender's local speakers, and once the sender was muted by hand the hardware volume keys only flashed the local mute bezel — receiver volume was adjustable solely from the app's slider. This PR makes streaming audio behave like a real output device:
NX_SYSDEFINEDevent tap redirects sound-up/down/mute to the connected sessions' stream volume — 1/16 steps, 1/64 with shift+option, mute toggles and restores the previous level — which the receiver applies to its system volume with its own HUD. Events pass through untouched whenever nothing is streaming audio, so normal local volume behavior is unaffected.Implementation notes
kAudioDevicePropertyMuteon the default output); devices without a settable mute control are left alone.Testing
xcodebuild test(TBDisplaySender scheme): 68/68 pass.Generated with Claude Code
Cheeky claude adding the watermark.