From a97d0107af2ee13bfa0d80597426da83d5f50e6c Mon Sep 17 00:00:00 2001 From: Beingpax Date: Fri, 1 Aug 2025 18:17:19 +0545 Subject: [PATCH] Move stop sound to transcription start --- VoiceInk/Recorder.swift | 5 ----- VoiceInk/Whisper/WhisperState.swift | 9 ++++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/VoiceInk/Recorder.swift b/VoiceInk/Recorder.swift index 12937ee..4837c98 100644 --- a/VoiceInk/Recorder.swift +++ b/VoiceInk/Recorder.swift @@ -155,11 +155,6 @@ class Recorder: ObservableObject { // Complete system audio operations first await mediaController.unmuteSystemAudio() await playbackController.resumeMedia() - - // Then play stop sound on main thread after audio operations are complete - await MainActor.run { - SoundManager.shared.playStopSound() - } } deviceManager.isRecordingActive = false } diff --git a/VoiceInk/Whisper/WhisperState.swift b/VoiceInk/Whisper/WhisperState.swift index 6b4b6c5..bcb4a75 100644 --- a/VoiceInk/Whisper/WhisperState.swift +++ b/VoiceInk/Whisper/WhisperState.swift @@ -171,7 +171,6 @@ class WhisperState: NSObject, ObservableObject { await MainActor.run { self.recordingState = .recording - SoundManager.shared.playStartSound() } await ActiveWindowService.shared.applyConfigurationForCurrentApp() @@ -227,6 +226,14 @@ class WhisperState: NSObject, ObservableObject { recordingState = .transcribing } + // Play stop sound when transcription starts with a small delay + Task { + try? await Task.sleep(nanoseconds: 100_000_000) // 100 milliseconds delay + await MainActor.run { + SoundManager.shared.playStopSound() + } + } + defer { if shouldCancelRecording { Task {