Skip to content

feat(macos): native mic capture via ffmpeg avfoundation - #68

Merged
ElbertePlinio merged 1 commit into
mainfrom
feat/macos-audio
Jul 24, 2026
Merged

ElbertePlinio merged 1 commit into
mainfrom
feat/macos-audio

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

PR 2 of #66.

  • recorder_args() pure seam in src/engine/recorder.rs: pw-record args byte-identical (pinned by test); ffmpeg/avfoundation shape (-i :default or :<audio_target>, 16k/mono/s16 WAV) selected by recorder file stem
  • Platform default recorder: ffmpeg on macOS, pw-record on Linux (default_recorder_command()); explicit user config untouched
  • Doctor "Audio recorder" check platform-aware and pre-early-return
  • "Native audio capture" blocker removed from macOS platform support (dictation_supported stays false until the loop is proven)
  • src-tauri/Info.plist with NSMicrophoneUsageDescription (Tauri 2 auto-merges into the bundle)

Design deviation from the #66 plan text (cpal → ffmpeg) recorded on the issue: ffmpeg is already an unconditional product dependency and emits exactly the WAV format the whisper pipeline consumes, reusing all existing process/stop/log machinery.

Validated on macOS hardware: 122 engine + 37 shell tests, clippy -D warnings clean, and a live capture smoke — real 2s recording via the exact ffmpeg args, SIGINT finalize, valid 37KB WAV.

🤖 Generated with Claude Code

Route macOS recording through ffmpeg's avfoundation input device instead
of a separate CoreAudio backend, since ffmpeg is already a required
dependency and emits the same 16kHz/mono/s16 WAV the whisper pipeline
consumes. Introduces a pure recorder_args() seam in recorder.rs so both
the pw-record and ffmpeg argument shapes are unit-tested; SttConfig's
default recorder is now platform-dependent (ffmpeg on macOS, pw-record
on Linux) while explicit user config is unaffected. Removes the "Native
audio capture" release blocker for macOS, moves the doctor page's
recorder check ahead of the dictation-support early return and makes it
platform-aware, and adds src-tauri/Info.plist with
NSMicrophoneUsageDescription for the macOS bundle.
@ElbertePlinio
ElbertePlinio merged commit 5f2d275 into main Jul 24, 2026
4 checks passed
@ElbertePlinio ElbertePlinio mentioned this pull request Jul 24, 2026
11 tasks done
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.

1 participant