Repository navigation
feat(audio): pause or lower media while dictating - #504
Merged
Merged
Conversation
|
Warning Review limit reachedYou'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. View limit details
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. |
# Conflicts: # src-tauri/src/managers/audio.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
kAudioProcessPropertyIsRunningOutput(macOS 14+, excluding Murmur, system sound daemons, and call apps) to detect active playback even on macOS 15.4+ whereMRMediaRemoteGetNowPlayingApplicationIsPlayingis restricted, with a pre-macOS 14 fallback toMRMediaRemoteGetNowPlayingApplicationIsPlaying. Sends explicitkMRPause/kMRPlaycommands (never toggle) and verifies a process actually paused before resuming.VirtualMainVolumeto 20% via Core Audio HAL (with anosascriptfallback when unavailable) so Bluetooth headset profiles stay intact and no extra permissions are needed; skips restoring if the user adjusted volume manually mid-dictation.#[cfg(target_os = "windows")]no-op while keeping the setting schema and state machine cross-platform).Closes #483
Changes
MediaBehavior(off,pause,lower_volume) toAppSettings,change_media_during_dictation_settingcommand, ACL manifest/permissions, and regeneratedsrc/bindings.ts.src-tauri/src/managers/audio/media.rs(MediaState, session-owned hold, pure rules, tests) andmedia/macos.rs(Core Audio +MediaRemotebackend).FinishGuard::drop, when a meeting starts, and onRunEvent::Exit.MediaDuringDictationdropdown in Settings → General → Sound (hidden on Windows) with translations across all six locales (en,fr,es,de,it,pt).managers::audio::media::tests,settings::tests,exit_tests) andtests/media-during-dictation.spec.ts.Testing
bun run checksteps: 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, andcargo clippy --locked --all-targets --all-features -- -D warningsall passed (bun auditfails on pre-existingcross-spawn@7.1.0onorigin/main).cargo test --locked --lib: 1707 passed, 0 failed (including 13 newmanagers::audio::media::tests, new settings test, and exit test).media-during-dictation,settings-labels-fitacross 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.