Skip to content

feat(audio): pause or lower media while dictating - #504

Merged
DailyXplorer merged 4 commits into
mainfrom
feat/pause-media-while-dictating
Dec 4, 2026
Merged

DailyXplorer merged 4 commits into
mainfrom
feat/pause-media-while-dictating

Conversation

@DailyXplorer

Copy link
Copy Markdown
Owner

Summary

Music or video playing while dictating disturbs both the speaker and transcription. This adds a three-choice setting (Off, Pause media, Lower volume) that pauses active playback or ducks output volume during a dictation and restores it right after the paste, without ever resuming media the user had already paused or activating during a meeting recording.

Design choices:

  • macOS pause/resume: Uses Core Audio's public per-process kAudioProcessPropertyIsRunningOutput (macOS 14+, excluding Murmur, system sound daemons, and call apps) to detect active playback even on macOS 15.4+ where MRMediaRemoteGetNowPlayingApplicationIsPlaying is restricted, with a pre-macOS 14 fallback to MRMediaRemoteGetNowPlayingApplicationIsPlaying. Sends explicit kMRPause / kMRPlay commands (never toggle) and verifies a process actually paused before resuming.
  • macOS volume lowering: Ducks the default output device's VirtualMainVolume to 20% via Core Audio HAL (with an osascript fallback when unavailable) so Bluetooth headset profiles stay intact and no extra permissions are needed; skips restoring if the user adjusted volume manually mid-dictation.
  • Windows: Kept macOS-only for now (UI row hidden on Windows, Rust backend is a #[cfg(target_os = "windows")] no-op while keeping the setting schema and state machine cross-platform).

Closes #483

Changes

  • Added MediaBehavior (off, pause, lower_volume) to AppSettings, change_media_during_dictation_setting command, ACL manifest/permissions, and regenerated src/bindings.ts.
  • Added src-tauri/src/managers/audio/media.rs (MediaState, session-owned hold, pure rules, tests) and media/macos.rs (Core Audio + MediaRemote backend).
  • Wired engage on recording readiness (skipped if a meeting is recording) and release right after paste, on cancel, in FinishGuard::drop, when a meeting starts, and on RunEvent::Exit.
  • Added MediaDuringDictation dropdown in Settings → General → Sound (hidden on Windows) with translations across all six locales (en, fr, es, de, it, pt).
  • Added Rust unit tests (managers::audio::media::tests, settings::tests, exit_tests) and tests/media-during-dictation.spec.ts.

Testing

  • bun run check steps: translations, platform rules + tests, file size + tests, Playwright path filter + tests, doctests + tests, updater manifest, release contract, changed paths, versions, macOS expanded diff tests, ESLint, Prettier + cargo fmt --check, frontend build, test typecheck, and cargo clippy --locked --all-targets --all-features -- -D warnings all passed (bun audit fails on pre-existing cross-spawn@7.1.0 on origin/main).
  • cargo test --locked --lib: 1707 passed, 0 failed (including 13 new managers::audio::media::tests, new settings test, and exit test).
  • Playwright (media-during-dictation, settings-labels-fit across all 6 locales, settings-no-inline-help, settings-organization, settings-control-widths, settings-control-sizes, settings-controls-a11y, settings-layout, windows-platform, no-all-caps): 133 passed, 0 failed.
  • Untested: Windows runtime behavior (kept macOS-only) and live end-to-end hardware dictation with a playing music app on macOS.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d2a0875 and b194320.

Files ignored due to path filters: 1

  • src/bindings.ts is excluded by !src/bindings.ts
Files selected for processing: 27

  • src-tauri/build.rs
  • src-tauri/permissions/default.toml
  • src-tauri/src/actions.rs
  • src-tauri/src/lib.rs
  • src-tauri/src/managers/audio.rs
  • src-tauri/src/managers/audio/media.rs
  • src-tauri/src/managers/audio/media/macos.rs
  • src-tauri/src/managers/audio/media/tests.rs
  • src-tauri/src/managers/audio/recording.rs
  • src-tauri/src/meetings/manager.rs
  • src-tauri/src/settings.rs
  • src-tauri/src/settings/defaults.rs
  • src-tauri/src/settings/tests.rs
  • src-tauri/src/settings/types.rs
  • src-tauri/src/shortcut/mod.rs
  • src/components/settings/MediaDuringDictation.tsx
  • src/components/settings/general/GeneralSettings.tsx
  • src/i18n/locales/de/translation.json
  • src/i18n/locales/en/translation.json
  • src/i18n/locales/es/translation.json
  • src/i18n/locales/fr/translation.json
  • src/i18n/locales/it/translation.json
  • src/i18n/locales/pt/translation.json
  • src/stores/settingsStore.ts
  • tests/fixtures/settings-pages/responses.ts
  • tests/fixtures/settings-pages/settings.ts
  • tests/media-during-dictation.spec.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@DailyXplorer
DailyXplorer merged commit fcdeecb into main Dec 4, 2026
24 checks passed
@DailyXplorer
DailyXplorer deleted the feat/pause-media-while-dictating branch December 4, 2026 23:39
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.

Idea: pause media playback while dictating

1 participant