Skip to content

Commit 9f6354f

Browse files
committed
Always restart VAD after dictation ends
stopAndPaste had early returns for empty text that skipped the startWakeListeningIfNeeded call. Use defer to guarantee VAD restarts regardless of which code path exits the method. Made-with: Cursor
1 parent 005ecdc commit 9f6354f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

voxtral_realtime/macos/VoxtralRealtime/Services/DictationManager.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ final class DictationManager {
182182
dismissPanel()
183183
log.info("Dictation stopped, text length: \(rawText.count)")
184184

185+
defer {
186+
store.wakeState = preferences.enableSileroVAD ? .listening : .disabled
187+
Task { await startWakeListeningIfNeeded() }
188+
}
189+
185190
guard !rawText.isEmpty else { return }
186191

187192
let result = store.processDictationText(rawText)
@@ -210,8 +215,6 @@ final class DictationManager {
210215
duration: duration,
211216
wakeTriggered: wakeTriggeredForCurrentSession
212217
)
213-
store.wakeState = preferences.enableSileroVAD ? .listening : .disabled
214-
await startWakeListeningIfNeeded()
215218
}
216219

217220
// MARK: - Silence Detection

0 commit comments

Comments
 (0)