feat: add PocketStation application audio capture - #82
Conversation
|
Thanks! this looks close, but I’d like one more round of validation before merging:
|
Review: PocketStation application audio captureReviewed across code quality, error handling, tests, comments, and types. Checked out the branch and confirmed all 11 audio tests pass locally. Solid, well-scoped feature — privacy invariants are respected (dual opt-in gate unchanged, temp dir cleaned via context manager, single reused Important1. Exit code 2. Implicit contract between the stem.record(source)
...
captured = Path(recording.session_directory) / "stems" / f"{source}.wav"The code passes the source category ( Suggestions3. Module docstring is stale — 4. 5. Test coverage gaps —
These are cheap pure-logic branches and exactly the paths a user hits when something goes wrong. 6. Strengths
Recommended action
|
What does this PR do?
Adds PocketStation as an optional recorder for one desktop application or the default microphone. ScreenSight's existing
soundcardsystem-output recorder remains the default.Users can now run:
The same choices are available through
screen_capture_audio. Application selection accepts an exact display name,bundle:<id>, orpid:<number>.This extends the audio work from #4 without changing screenshot capture,
CaptureOutcome, watch mode, MCP registration, or the existing system-audio implementation.Type of change
Testing
pytest tests/ -vpasses locallyPlatform(s) I actually ran this on:
pocketstation==0.1.3installed from PyPIafplayby process ID: 48 kHz stereo float WAV, 2.005 s, audible signal, SHA-2565525a0634a2a7587a18b5463178f2d92f8dfb6eb6eecfd99a886854efb69ab295e6fd81bbba753155bf49e8ca53a72e9afc8985c3d15bb1195811cb56390d5cdChecks run:
pocketstationextraThe repository's existing generic
check-yamlhook cannot parse the Python tags used bymkdocs.yml; the strict MkDocs build passes.Privacy invariants
core.capture_once().core.py; audio still requiresSCREENSIGHT_ENABLE_AUDIO=1as a second explicit opt-in.audio.wav, and removes the temporary recording.Notes for reviewers
One
--sourceoption keeps the behavior explicit:system: existingsoundcardrecorderapplication: PocketStation, with--applicationmicrophone: PocketStation's default input selectionscreensight offcontinues to delete the singleaudio.wavfile.