Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
fix: media pause improvements and settings toggle bug
Alcahest2a8584d79610
diff --git a/src/helpers/mediaPlayer.js b/src/helpers/mediaPlayer.jsindex 5245d3b30..e52f8601f 100644--- a/src/helpers/mediaPlayer.js+++ b/src/helpers/mediaPlayer.js@@ -76,6 +76,9 @@ class MediaPlayer {}_toggleLinux() {+ // Try MPRIS D-Bus first — works reliably on both X11 and Wayland+ if (this._toggleMpris()) return true;+const binary = this._resolveLinuxFastPaste();if (binary) {const result = spawnSync(binary, ["--media-play-pause"], {@@ -102,6 +105,36 @@ class MediaPlayer {return false;}+ _toggleMpris() {+ const listResult = spawnSync("dbus-send", [+ "--session", "--dest=org.freedesktop.DBus", "--type=method_call",+ "--print-reply", "/org/freedesktop/DBus",+ "org.freedesktop.DBus.ListNames",+ ], { stdio: "pipe", timeout: 2000 });++ if (listResult.status !== 0) return false;++ const output = listResult.stdout?.toString() || "";+ const players = output.match(/string "org\.mpris\.MediaPlayer2\.[^"]+"/g);+ if (!players || players.length === 0) return false;++ let toggled = false;+ for (const match of players) {+ const dest = match.replace(/^string "/, "").replace(/"$/, "");+ const result = spawnSync("dbus-send", [+ "--session", "--type=method_call", `--dest=${dest}`,+ "/org/mpris/MediaPlayer2",+ "org.mpris.MediaPlayer2.Player.PlayPause",+ ], { stdio: "pipe", timeout: 2000 });++ if (result.status === 0) {+ debugLogger.debug("Media toggled via MPRIS", { player: dest }, "media");+ toggled = true;+ }+ }+ return toggled;+ }+_toggleMacOS() {const result = spawnSync("osascript", ["-e",@@ -130,10 +163,10 @@ class MediaPlayer {}}- // Fallback to PowerShell+ // Fallback to PowerShell using keybd_event for VK_MEDIA_PLAY_PAUSEconst result = spawnSync("powershell", ["-NoProfile", "-NonInteractive", "-Command",- "$wsh = New-Object -ComObject WScript.Shell; $wsh.SendKeys([char]0xB3)",+ "Add-Type -TypeDefinition 'using System.Runtime.InteropServices; public class KB { [DllImport(\"user32.dll\")] public static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); }'; [KB]::keybd_event(0xB3, 0, 1, 0); [KB]::keybd_event(0xB3, 0, 3, 0)",], {stdio: "pipe",timeout: 5000,diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.tsindex 230576d8f..ea028f3a2 100644--- a/src/hooks/useSettings.ts+++ b/src/hooks/useSettings.ts@@ -213,6 +213,8 @@ function useSettingsInternal() {setActivationMode: store.setActivationMode,audioCuesEnabled: store.audioCuesEnabled,setAudioCuesEnabled: store.setAudioCuesEnabled,+ pauseMediaOnDictation: store.pauseMediaOnDictation,+ setPauseMediaOnDictation: store.setPauseMediaOnDictation,floatingIconAutoHide: store.floatingIconAutoHide,setFloatingIconAutoHide: store.setFloatingIconAutoHide,preferBuiltInMic: store.preferBuiltInMic,