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

fix: complete spoken send after quiet countdown

altic-dev95fe1b15c4c2
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index 2c232842..7ca294ac 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -283,7 +283,6 @@ struct ContentView: View {
@State private var overlayLifecycleID: UInt64 = 0
@State private var spokenSendAutoStopTask: Task<Void, Never>?
@State private var spokenSendAutoStopTriggered = false
- @State private var spokenSendPartialRevision: UInt64 = 0
@State private var spokenSendCountdownStartedAt: TimeInterval?
@State private var spokenSendLastVoiceActivityAt: TimeInterval = 0
@State private var spokenSendVoiceActivityCancellable: AnyCancellable?
@@ -2509,7 +2508,6 @@ struct ContentView: View {
self.spokenSendAutoStopTask = nil
self.stopSpokenSendVoiceActivityMonitoring()
self.spokenSendAutoStopTriggered = false
- self.spokenSendPartialRevision = 0
self.spokenSendCountdownStartedAt = nil
self.spokenSendLastVoiceActivityAt = ProcessInfo.processInfo.systemUptime
self.overlayLifecycleID &+= 1
@@ -2518,7 +2516,6 @@ struct ContentView: View {
private func handleSpokenSendPartialTranscription(_ text: String) {
guard self.settings.spokenSendEnabled else { return }
- self.spokenSendPartialRevision &+= 1
let isDictationMode = self.activeRecordingMode == .dictate || self.activeRecordingMode == .promptMode
let shouldStop = isDictationMode &&
self.currentDictationOutputRouteForHotkeyStop() == .normal &&
@@ -2549,7 +2546,6 @@ struct ContentView: View {
}
let expectedOverlayLifecycleID = self.overlayLifecycleID
- let expectedPartialRevision = self.spokenSendPartialRevision
let countdownStartedAt = ProcessInfo.processInfo.systemUptime
self.spokenSendCountdownStartedAt = countdownStartedAt
self.spokenSendLastVoiceActivityAt = countdownStartedAt
@@ -2571,7 +2567,6 @@ struct ContentView: View {
phrase: self.settings.spokenSendPhrase,
spokenSendEnabled: self.settings.spokenSendEnabled,
sendImmediatelyEnabled: self.settings.spokenSendImmediatelyEnabled,
- receivedFreshTranscript: self.spokenSendPartialRevision > expectedPartialRevision,
quietDuration: quietDuration
)
else {
diff --git a/Sources/Fluid/Services/SpokenSendParser.swift b/Sources/Fluid/Services/SpokenSendParser.swift
index 982e411c..35ac9804 100644
--- a/Sources/Fluid/Services/SpokenSendParser.swift
+++ b/Sources/Fluid/Services/SpokenSendParser.swift
@@ -27,11 +27,9 @@ enum SpokenSendParser {
phrase: String,
spokenSendEnabled: Bool,
sendImmediatelyEnabled: Bool,
- receivedFreshTranscript: Bool,
quietDuration: TimeInterval
) -> Bool {
- receivedFreshTranscript &&
- quietDuration >= self.immediateStopRequiredSilenceDuration &&
+ quietDuration >= self.immediateStopRequiredSilenceDuration &&
self.shouldStopImmediately(
text,
phrase: phrase,
diff --git a/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift b/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift
index cadda369..fc6b3221 100644
--- a/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift
+++ b/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift
@@ -144,7 +144,7 @@ final class SpokenSendTests: XCTestCase {
)
}
- func testImmediateStopCompletionRequiresFreshTranscriptAndSilence() {
+ func testImmediateStopCompletionRequiresTerminalPhraseAndSilence() {
let arguments = (
text: "Ready, send it.",
phrase: "send it",
@@ -158,17 +158,6 @@ final class SpokenSendTests: XCTestCase {
phrase: arguments.phrase,
spokenSendEnabled: arguments.spokenSendEnabled,
sendImmediatelyEnabled: arguments.sendImmediatelyEnabled,
- receivedFreshTranscript: false,
- quietDuration: 2
- )
- )
- XCTAssertFalse(
- SpokenSendParser.canCompleteImmediateStop(
- arguments.text,
- phrase: arguments.phrase,
- spokenSendEnabled: arguments.spokenSendEnabled,
- sendImmediatelyEnabled: arguments.sendImmediatelyEnabled,
- receivedFreshTranscript: true,
quietDuration: 0
)
)
@@ -178,7 +167,6 @@ final class SpokenSendTests: XCTestCase {
phrase: arguments.phrase,
spokenSendEnabled: arguments.spokenSendEnabled,
sendImmediatelyEnabled: arguments.sendImmediatelyEnabled,
- receivedFreshTranscript: true,
quietDuration: SpokenSendParser.immediateStopRequiredSilenceDuration
)
)
@@ -191,7 +179,6 @@ final class SpokenSendTests: XCTestCase {
phrase: "send it",
spokenSendEnabled: true,
sendImmediatelyEnabled: true,
- receivedFreshTranscript: true,
quietDuration: 2
)
)