Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

bug fix causing crash when you spam rrecord key

altic-devd7349b4ced42
diff --git a/Sources/Fluid/Services/ASRService.swift b/Sources/Fluid/Services/ASRService.swift
index 543c34be..2b686ca2 100644
--- a/Sources/Fluid/Services/ASRService.swift
+++ b/Sources/Fluid/Services/ASRService.swift
@@ -109,6 +109,7 @@ final class ASRService: ObservableObject {
@Published var downloadProgress: Double? = nil
@Published var downloadingModelId: String? = nil // Tracks which model is currently being downloaded
+ private var isStarting: Bool = false // Guard against re-entrant start() calls
private var downloadProgressTask: Task<Void, Never>?
private var hasCompletedFirstTranscription: Bool = false // Track if model has warmed up with first transcription
private let downloadRegistry = ModelDownloadRegistry()
@@ -507,8 +508,8 @@ final class ASRService: ObservableObject {
DebugLogger.shared.error("❌ START() blocked - mic not authorized", source: "ASRService")
return
}
- guard self.isRunning == false else {
- DebugLogger.shared.warning("⚠️ START() blocked - already running", source: "ASRService")
+ guard self.isRunning == false, self.isStarting == false else {
+ DebugLogger.shared.warning("⚠️ START() blocked - already running (started: \(isRunning), starting: \(isStarting))", source: "ASRService")
return
}
@@ -526,6 +527,9 @@ final class ASRService: ObservableObject {
self.audioCapturePipeline.setRecordingEnabled(true)
DebugLogger.shared.debug("✅ Buffers cleared", source: "ASRService")
+ self.isStarting = true
+ defer { self.isStarting = false }
+
do {
DebugLogger.shared.debug("⚙️ Calling configureSession()...", source: "ASRService")
try self.configureSession()