Skip to content

Add ScreenCaptureKit audio capture for macOS#1388

Open
adamdexter wants to merge 1 commit intochidiwilliams:mainfrom
adamdexter:feature/screencapturekit-audio
Open

Add ScreenCaptureKit audio capture for macOS#1388
adamdexter wants to merge 1 commit intochidiwilliams:mainfrom
adamdexter:feature/screencapturekit-audio

Conversation

@adamdexter
Copy link

Summary

  • Adds system audio capture as an alternative to microphone input on macOS using ScreenCaptureKit
  • Introduces a Swift helper binary (buzz-screen-audio) that captures system audio and streams 16kHz mono float32 PCM via stdout
  • Adds an AudioSource abstraction layer (SoundDeviceAudioSource / ScreenCaptureAudioSource) so RecordingTranscriber can use either source
  • Integrates an "Audio Source" dropdown in the recording widget UI, with "Screen Audio" available on macOS when the helper binary is present
  • Persists audio source selection across sessions

Test plan

  • Verify "Screen Audio" option appears in the Audio Source dropdown on macOS when the helper binary is built
  • Verify "Screen Audio" option does not appear on non-macOS platforms
  • Record a transcription using Screen Audio and confirm audio is captured correctly
  • Record a transcription using Microphone and confirm existing behavior is unchanged
  • Verify microphone selector hides when Screen Audio is selected
  • Verify audio source selection is saved and restored between sessions
  • Run pytest tests/test_audio_source.py — all 11 tests pass

🤖 Generated with Claude Code

Introduces system audio capture as an alternative to microphone input
using macOS ScreenCaptureKit. Includes a Swift helper binary that
captures and streams 16kHz mono float32 PCM, an AudioSource abstraction
layer, and full UI integration with an audio source selector dropdown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@raivisdejus
Copy link
Collaborator

@adamdexter Nice idea, valuable addition. I will check this and give comments or merge. Hope to find time for this in a few coming weekends

Comment on lines +17 to +29
def get_screen_audio_helper_path() -> Optional[str]:
"""Locate the buzz-screen-audio helper binary.

Follows the same two-level resolution pattern used for whisper-cli
in recording_transcriber.py and whisper_cpp.py.
"""
path = os.path.join(APP_BASE_DIR, "whisper_cpp", SCREEN_AUDIO_HELPER_NAME)
if os.path.isfile(path):
return path
path = os.path.join(APP_BASE_DIR, "buzz", "whisper_cpp", SCREEN_AUDIO_HELPER_NAME)
if os.path.isfile(path):
return path
return None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen audio helper should not live in whisper_cpp folder

@raivisdejus
Copy link
Collaborator

@adamdexter Checked the implementation and a thing that is immediately missing is some build instructions. Main app is built via Makefile See if you can add build commands for screen_capture helper there as well.

Feature is useful, so I can look into the missing parts myself as well, at some later free moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants