Skip to content

feat(audio): add mute system output during dictation#511

Open
NathanSkene wants to merge 2 commits intoOpenWhispr:mainfrom
NathanSkene:codex/media-pause-macos-generalize
Open

feat(audio): add mute system output during dictation#511
NathanSkene wants to merge 2 commits intoOpenWhispr:mainfrom
NathanSkene:codex/media-pause-macos-generalize

Conversation

@NathanSkene
Copy link
Copy Markdown
Contributor

Summary

  • add a separate Mute system output while recording option alongside the existing Pause media setting
  • mute macOS system output on recording start and restore the prior sound state on completion, cancel, or error
  • expose the new behavior through IPC, settings state, recording lifecycle, and all locale files

Why

The existing Pause media feature works well for supported players like Spotify, but unsupported apps such as Brain.fm desktop do not reliably expose a pause/resume control path. This new option directly solves the underlying recording-quality problem by silencing computer audio during dictation regardless of which app is producing it.

Closes #510

Test plan

  • Enable Mute system output while recording in settings
  • Trigger mute/restore directly on macOS and confirm all computer audio cuts out and returns
  • Confirm the new setting is wired through store, preload, IPC, and recording lifecycle
  • Full in-app recording flow retest in the packaged app

}

_buildMacUiMenuScript(appName, labels) {
const appleScriptList = labels.map((label) => `"${label.replace(/"/g, '\\"')}"`).join(", ");

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

_buildMacUiMenuScript(appName, labels) {
const appleScriptList = labels.map((label) => `"${label.replace(/"/g, '\\"')}"`).join(", ");
const escapedAppName = appName.replace(/"/g, '\\"');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
@NathanSkene
Copy link
Copy Markdown
Contributor Author

Validation update from local macOS testing:

  • Pause media works for Spotify.
  • Pause media does not pause Brain.fm desktop on macOS.
  • Mute system output while recording does work in the installed app and solves the recording-contamination problem for unsupported apps like Brain.fm.
  • I also pushed commit 76db1dc to make both Pause media and Mute system output while recording default to enabled for fresh installs / unset settings.

The installed /Applications/OpenWhispr Dev.app was rebuilt locally and the mute-output path was verified end-to-end during real recording tests.

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.

Add separate "Mute system output while recording" option

2 participants