From fef9d959168da74afebf118b7d58b6dcadc9880e Mon Sep 17 00:00:00 2001 From: Ali Alavi Date: Sun, 23 Aug 2026 11:24:34 +0000 Subject: [PATCH] fix(mac): remove all sounds and make mac app operation 100% silent --- mac/src/AppDelegate.swift | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/mac/src/AppDelegate.swift b/mac/src/AppDelegate.swift index ab9bd98..7f8b88d 100644 --- a/mac/src/AppDelegate.swift +++ b/mac/src/AppDelegate.swift @@ -15,9 +15,8 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { private var remoteListener: NWListener? public func applicationDidFinishLaunching(_ notification: Notification) { - if UserDefaults.standard.object(forKey: "SonioxPlaySounds") == nil { - UserDefaults.standard.set(true, forKey: "SonioxPlaySounds") - } + // Completely silent operation by default + UserDefaults.standard.set(false, forKey: "SonioxPlaySounds") statusBarController = StatusBarController() statusBarController.onToggleRecording = { [weak self] in @@ -63,8 +62,7 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { // Connect to Linux Persistent Gateway (via local tunnel 18999 -> 8999) RelayClient.shared.onRemoteUpdateReceived = { [weak self] text, cursor, isFullReplace in guard let self = self else { return } - print("AppDelegate: 📥 Clean Remote Input Update: '\(text.prefix(30))...' (replace: \(isFullReplace))") - self.playSystemSound(name: "Tink") + print("AppDelegate: 📥 Clean Remote Input Update (Silent): '\(text.prefix(30))...' (replace: \(isFullReplace))") HUDOverlayController.shared.show(state: .success(text: text)) FocusedInputSync.shared.applyRemoteUpdate(text: text, cursor: cursor, isFullReplace: isFullReplace) } @@ -115,7 +113,6 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { let text = json["text"] as? String { DispatchQueue.main.async { - self.playSystemSound(name: "Tink") FocusedInputSync.shared.applyRemoteUpdate(text: text, cursor: nil, isFullReplace: true) } } @@ -152,7 +149,6 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { guard !audioRecorder.isRecording, !isBusyFinalizing else { return } latestPartialText = nil - playSystemSound(name: "Blow") let session = SonioxSessionPool.shared.acquireSession() self.activeSession = session @@ -171,7 +167,6 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { switch result { case .success(let text): - self.playSystemSound(name: "Hero") FocusedInputSync.shared.applyRemoteUpdate(text: text, cursor: nil, isFullReplace: false) case .failure(let error): print("Soniox error:", error) @@ -206,9 +201,4 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { session.finalizeStream() } - - private func playSystemSound(name: String) { - guard UserDefaults.standard.bool(forKey: "SonioxPlaySounds") else { return } - NSSound(named: name)?.play() - } }