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

Keep meeting audio and make sources easier to choose (#1268)

ALTIC869a5b2117d3
diff --git a/Fluid.xcodeproj/project.pbxproj b/Fluid.xcodeproj/project.pbxproj
index 3eb65f09..c33913cc 100644
--- a/Fluid.xcodeproj/project.pbxproj
+++ b/Fluid.xcodeproj/project.pbxproj
@@ -1197,7 +1197,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
- MARKETING_VERSION = "1.6.13-beta.1";
+ MARKETING_VERSION = "1.6.13-beta.2";
PRODUCT_BUNDLE_IDENTIFIER = com.FluidApp.app.debug;
PRODUCT_NAME = "FluidVoice Debug";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1252,7 +1252,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
- MARKETING_VERSION = "1.6.13-beta.1";
+ MARKETING_VERSION = "1.6.13-beta.2";
PRODUCT_BUNDLE_IDENTIFIER = com.FluidApp.app;
PRODUCT_NAME = FluidVoice;
PROVISIONING_PROFILE_SPECIFIER = "";
diff --git a/Info.plist b/Info.plist
index 52ef77fd..b3ad4dad 100644
--- a/Info.plist
+++ b/Info.plist
@@ -15,7 +15,7 @@
<key>CFBundleVersion</key>
<string>31</string>
<key>CFBundleShortVersionString</key>
- <string>1.6.13-beta.1</string>
+ <string>1.6.13-beta.2</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSApplicationCategoryType</key>
diff --git a/Sources/Fluid/Services/Meeting/AEC/MeetingAECOutputCommitter.swift b/Sources/Fluid/Services/Meeting/AEC/MeetingAECOutputCommitter.swift
index 49e19ef6..3797ce98 100644
--- a/Sources/Fluid/Services/Meeting/AEC/MeetingAECOutputCommitter.swift
+++ b/Sources/Fluid/Services/Meeting/AEC/MeetingAECOutputCommitter.swift
@@ -27,6 +27,7 @@ final nonisolated class MeetingAECOutputCommitter: @unchecked Sendable {
private let protectionChanged: @Sendable (MeetingMicrophoneEchoProtection) -> Void
private let pending = DispatchGroup()
private var state: State = .unprotected
+ private var reportedProtection: MeetingMicrophoneEchoProtection?
private var generation: UInt64 = 0
/// Gate epoch captured when a promotion begins; the open succeeds only if nothing closed meanwhile.
private var promotionGateEpoch: UInt64 = 0
@@ -71,7 +72,17 @@ final nonisolated class MeetingAECOutputCommitter: @unchecked Sendable {
self.commitAdmitted(sampleBuffer, protection: .unfiltered)
}
- private func commitAdmitted(_ sampleBuffer: CMSampleBuffer, protection: MeetingMicrophoneEchoProtection) {
+ /// Keep opening speech while the filter learns, without claiming verified cancellation or
+ /// reporting normal warm-up as a filtering failure. Provenance still commits before live ASR.
+ func commitWarmup(_ sampleBuffer: CMSampleBuffer) {
+ self.commitAdmitted(sampleBuffer, protection: .unfiltered, reportsProtectionChange: false)
+ }
+
+ private func commitAdmitted(
+ _ sampleBuffer: CMSampleBuffer,
+ protection: MeetingMicrophoneEchoProtection,
+ reportsProtectionChange: Bool = true
+ ) {
let sampleBox = SampleBox(sampleBuffer)
let startSeconds = Self.seconds(of: sampleBuffer)
let action = self.lock.withLock { () -> (token: UInt64?, gateEpoch: UInt64) in
@@ -94,6 +105,7 @@ final nonisolated class MeetingAECOutputCommitter: @unchecked Sendable {
// earlier samples, including a rapid filtered-to-unfiltered transition.
_ = self.enqueueOrFail(sampleBox.sampleBuffer, startSeconds: startSeconds) { [self] in
self.offerLive(sampleBox, gateEpoch: action.gateEpoch)
+ if reportsProtectionChange { self.reportProtection(protection, gateEpoch: action.gateEpoch) }
}
return
}
@@ -131,9 +143,7 @@ final nonisolated class MeetingAECOutputCommitter: @unchecked Sendable {
return
}
self.offerLive(sampleBox, gateEpoch: action.gateEpoch)
- if self.transcriptGate.invalidationEpoch == action.gateEpoch {
- self.protectionChanged(protection)
- }
+ if reportsProtectionChange { self.reportProtection(protection, gateEpoch: action.gateEpoch) }
self.lock.withLock {
if self.generation == token { self.state = .admitted(protection) }
}
@@ -147,6 +157,16 @@ final nonisolated class MeetingAECOutputCommitter: @unchecked Sendable {
}
}
+ private func reportProtection(_ protection: MeetingMicrophoneEchoProtection, gateEpoch: UInt64) {
+ guard self.transcriptGate.invalidationEpoch == gateEpoch else { return }
+ let changed = self.lock.withLock {
+ guard self.reportedProtection != protection else { return false }
+ self.reportedProtection = protection
+ return true
+ }
+ if changed { self.protectionChanged(protection) }
+ }
+
private func offerLive(_ sample: SampleBox, gateEpoch: UInt64) {
if self.transcriptGate.observeAndAdmit(sample.sampleBuffer, since: gateEpoch) {
self.liveAudioHandler?(.microphone, sample.sampleBuffer)
diff --git a/Sources/Fluid/Services/Meeting/AEC/MeetingAECPipeline.swift b/Sources/Fluid/Services/Meeting/AEC/MeetingAECPipeline.swift
index 1b8aaaf5..8c0e2475 100644
--- a/Sources/Fluid/Services/Meeting/AEC/MeetingAECPipeline.swift
+++ b/Sources/Fluid/Services/Meeting/AEC/MeetingAECPipeline.swift
@@ -132,16 +132,22 @@ final nonisolated class MeetingAECPipeline: @unchecked Sendable {
capture: joined.capture.samples
)
self.diagnosticObserver?(joined, result.samples, result.statistics)
+ let mayPromote = joined.clockAttested
+ && joined.pairedFrameCount > MeetingAECConstants.attestationFrames
guard let output = MeetingAECPCMAdapter.synthesize(
- samples: result.samples,
+ samples: mayPromote ? result.samples : joined.capture.samples,
presentationTime: joined.capture.presentationTime
) else {
self.beginFallback(joined.capture, failure: .outputSynthesis, allowFallback: allowFallback)
return false
}
- let mayPromote = joined.clockAttested
- && joined.pairedFrameCount > MeetingAECConstants.attestationFrames
- self.committer.commitProcessed(output, mayPromote: mayPromote)
+ if mayPromote {
+ self.committer.commitProcessed(output, mayPromote: true)
+ } else if allowFallback {
+ self.committer.commitWarmup(output)
+ } else {
+ self.committer.commitRaw(output, failure: .stopped)
+ }
return true
} catch let failure as MeetingAECFailure {
self.beginFallback(joined.capture, failure: failure, allowFallback: allowFallback)
diff --git a/Sources/Fluid/Services/Meeting/Backend/MeetingParakeetNemotronBackend.swift b/Sources/Fluid/Services/Meeting/Backend/MeetingParakeetNemotronBackend.swift
index 55f3be53..cfbc6c3b 100644
--- a/Sources/Fluid/Services/Meeting/Backend/MeetingParakeetNemotronBackend.swift
+++ b/Sources/Fluid/Services/Meeting/Backend/MeetingParakeetNemotronBackend.swift
@@ -16,7 +16,7 @@ final class MeetingParakeetNemotronBackend: MeetingTranscriptionBackend {
static let descriptor = MeetingBackendDescriptor(
id: .parakeetNemotron,
- version: "8",
+ version: "10",
execution: .local,
supportedLanguageCodes: VoiceEngineLanguageCatalog.parakeetV3LanguageIDs,
supportedTrackKinds: Set(MeetingAudioTrackKind.allCases),
@@ -313,7 +313,9 @@ final class MeetingParakeetNemotronBackend: MeetingTranscriptionBackend {
}
try Task.checkCancellation()
do {
- let output = try await asr.transcribeWithTimings(materialized.samples)
+ // Parakeet rejects subsecond input. Pad only inference; the original
+ // sample count below still bounds word timings and coverage receipts.
+ let output = try await asr.transcribeWithTimings(Self.asrInput(materialized.samples))
result.outputs.append(MeetingParakeetEpochOutput(
epochID: work.epoch.id,
text: output.result.text,
@@ -374,6 +376,11 @@ final class MeetingParakeetNemotronBackend: MeetingTranscriptionBackend {
return materialized
}
+ nonisolated static func asrInput(_ samples: [Float]) -> [Float] {
+ guard !samples.isEmpty, samples.count < 16_000 else { return samples }
+ return samples + [Float](repeating: 0, count: 16_000 - samples.count)
+ }
+
// MARK: - Units, assignment and receipts
/// Pure assembly of the final bundle: units from provider word timings clamped only at
@@ -534,6 +541,9 @@ final class MeetingParakeetNemotronBackend: MeetingTranscriptionBackend {
}
}
+ // A provider without timings may supply an utterance. Rejected timed words must
+ // not return through that fallback, including words predicted only in padded silence.
+ guard output.words.isEmpty else { return [] }
let text = output.text.trimmingCharacters(in: .whitespacesAndNewlines)
guard !text.isEmpty else { return [] }
let spanIDs = work.spans.map(\.id)
diff --git a/Sources/Fluid/Services/Meeting/MeetingAppRegistry.swift b/Sources/Fluid/Services/Meeting/MeetingAppRegistry.swift
index 607eaef8..71322d01 100644
--- a/Sources/Fluid/Services/Meeting/MeetingAppRegistry.swift
+++ b/Sources/Fluid/Services/Meeting/MeetingAppRegistry.swift
@@ -73,6 +73,8 @@ nonisolated enum MeetingAppRegistry {
/// of the source pickers; nothing here is detected or prompted for.
static let otherCallAppBundleIdentifiers: [String] = [
"com.apple.FaceTime",
+ "com.apple.MobileSMS",
+ "com.apple.iChat",
"com.tinyspeck.slackmacgap",
"com.hnc.Discord",
"net.whatsapp.WhatsApp",
@@ -87,7 +89,7 @@ nonisolated enum MeetingAppRegistry {
"com.microsoft.teams",
"com.cisco.webexmeetingsapp",
"Cisco-Systems.Spark",
- ] + otherCallAppBundleIdentifiers
+ ]
private static let pickerBrowserOrder: [String] = [
"com.google.Chrome",
@@ -95,14 +97,23 @@ nonisolated enum MeetingAppRegistry {
"company.thebrowser.Browser",
"com.microsoft.edgemac",
"com.brave.Browser",
+ "org.mozilla.firefox",
+ "com.duckduckgo.macos.browser",
]
- /// Where an app belongs among the usual meeting sources, lower first: call apps, then browser
- /// web apps such as Google Meet's, then browsers. Nil for anything that is not a usual source.
+ static var commonPickerBundleIdentifiers: [String] {
+ self.pickerBrowserOrder + self.pickerCallAppOrder + self.otherCallAppBundleIdentifiers
+ }
+
+ /// Browsers and meeting apps first, then web apps and personal call apps. This ranking
+ /// changes only manual source pickers; automatic detection keeps its separate registry.
static func pickerRank(forBundleIdentifier bundleIdentifier: String) -> Int? {
- if let index = self.pickerCallAppOrder.firstIndex(of: bundleIdentifier) { return index }
- if self.pwaBundlePrefixes.contains(where: { bundleIdentifier.hasPrefix($0) }) { return self.pickerCallAppOrder.count }
- if let index = self.pickerBrowserOrder.firstIndex(of: bundleIdentifier) { return self.pickerCallAppOrder.count + 1 + index }
+ if let index = self.pickerBrowserOrder.firstIndex(of: bundleIdentifier) { return index }
+ let nativeOffset = self.pickerBrowserOrder.count
+ if let index = self.pickerCallAppOrder.firstIndex(of: bundleIdentifier) { return nativeOffset + index }
+ let webAppOffset = nativeOffset + self.pickerCallAppOrder.count
+ if self.pwaBundlePrefixes.contains(where: { bundleIdentifier.hasPrefix($0) }) { return webAppOffset }
+ if let index = self.otherCallAppBundleIdentifiers.firstIndex(of: bundleIdentifier) { return webAppOffset + 1 + index }
return nil
}
diff --git a/Sources/Fluid/Services/Meeting/MeetingInstalledCallApplications.swift b/Sources/Fluid/Services/Meeting/MeetingInstalledCallApplications.swift
new file mode 100644
index 00000000..57f95118
--- /dev/null
+++ b/Sources/Fluid/Services/Meeting/MeetingInstalledCallApplications.swift
@@ -0,0 +1,55 @@
+import AppKit
+import Foundation
+
+nonisolated struct MeetingInstalledCallApplication: Sendable {
+ let bundleIdentifier: String
+ let displayName: String
+ var isRunning = false
+}
+
+nonisolated struct MeetingAppPickerEntry: Identifiable, Sendable {
+ let bundleIdentifier: String
+ let displayName: String
+ let application: MeetingApplicationIdentity?
+ var isRunning = false
+
+ var id: String { "\(self.bundleIdentifier)-\(self.application?.processID ?? 0)" }
+ var unavailableLabel: String { "\(self.displayName) · \(self.isRunning ? "Not available" : "Not running")" }
+
+ static func entries(
+ applications: [MeetingApplicationIdentity],
+ installed: [MeetingInstalledCallApplication]
+ ) -> [Self] {
+ var entries = applications.map {
+ Self(bundleIdentifier: $0.bundleIdentifier, displayName: $0.displayName, application: $0, isRunning: true)
+ }
+ var availableBundles = Set(applications.map(\.bundleIdentifier))
+ for app in installed where availableBundles.insert(app.bundleIdentifier).inserted {
+ entries.append(Self(bundleIdentifier: app.bundleIdentifier, displayName: app.displayName, application: nil, isRunning: app.isRunning))
+ }
+ return entries
+ }
+}
+
+nonisolated enum MeetingInstalledCallApplications {
+ /// A bounded snapshot once per picker opening. No app or disk discovery runs in view rendering.
+ static func snapshot() async -> [MeetingInstalledCallApplication] {
+ await Task.detached(priority: .utility) {
+ let workspace = NSWorkspace.shared
+ let running = Set(workspace.runningApplications.compactMap(\.bundleIdentifier))
+ var seen = Set<String>()
+ return MeetingAppRegistry.commonPickerBundleIdentifiers.compactMap { bundle -> MeetingInstalledCallApplication? in
+ guard let url = workspace.urlForApplication(withBundleIdentifier: bundle),
+ FileManager.default.fileExists(atPath: url.path)
+ else { return nil }
+ let info = Bundle(url: url)
+ let identifier = info?.bundleIdentifier ?? bundle
+ guard seen.insert(identifier).inserted else { return nil }
+ let name = (info?.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String)
+ ?? (info?.object(forInfoDictionaryKey: "CFBundleName") as? String)
+ ?? url.deletingPathExtension().lastPathComponent
+ return MeetingInstalledCallApplication(bundleIdentifier: identifier, displayName: name, isRunning: running.contains(identifier))
+ }
+ }.value
+ }
+}
diff --git a/Sources/Fluid/UI/MeetingRecordingSourcePrompt.swift b/Sources/Fluid/UI/MeetingRecordingSourcePrompt.swift
index 1f24d628..397e28dc 100644
--- a/Sources/Fluid/UI/MeetingRecordingSourcePrompt.swift
+++ b/Sources/Fluid/UI/MeetingRecordingSourcePrompt.swift
@@ -12,6 +12,7 @@ nonisolated struct MeetingRecordingSourceSnapshot: Sendable {
var selectedMicrophoneID: String?
var sourceMessage: String?
var recentApplication: MeetingApplicationIdentity?
+ var installedApplications: [MeetingInstalledCallApplication] = []
var microphoneSelectionLabel: String {
if let selected = self.microphones.identities.first(where: { $0.captureDeviceID == self.selectedMicrophoneID }) {
@@ -248,6 +249,7 @@ final class MeetingRecordingSourcePromptController: ObservableObject {
}
private static func loadSnapshot(foreground: MeetingApplicationIdentity?) async throws -> MeetingRecordingSourceSnapshot {
+ async let installedApplications = MeetingInstalledCallApplications.snapshot()
let defaults = SettingsStore.shared.meetingRecordingDefaults
let target = AppServices.shared.meetingAutomaticTarget
let preferredInputUID = SettingsStore.shared.preferredInputDeviceUID
@@ -281,7 +283,8 @@ final class MeetingRecordingSourcePromptController: ObservableObject {
defaults: defaults, target: target, foreground: foreground, applications: applications
),
selectedMicrophoneID: selection.deviceID,
- sourceMessage: sourceMessage
+ sourceMessage: sourceMessage,
+ installedApplications: await installedApplications
)
}
@@ -367,9 +370,10 @@ struct MeetingRecordingSourcePromptContent: View {
private func sourceSelector(_ snapshot: MeetingRecordingSourceSnapshot) -> some View {
let recent = snapshot.availableRecentApplication
let sections = MeetingAppRegistry.pickerSections(
- snapshot.applications.filter { $0 != recent }.map(MeetingApplicationOption.init),
- bundleIdentifier: { $0.identity.bundleIdentifier },
- name: { $0.identity.displayName },
+ MeetingAppPickerEntry.entries(applications: snapshot.applications, installed: snapshot.installedApplications)
+ .filter { $0.application != recent || recent == nil },
+ bundleIdentifier: { $0.bundleIdentifier },
+ name: { $0.displayName },
isBackgroundItem: { _ in false }
)
return Menu {
@@ -380,15 +384,17 @@ struct MeetingRecordingSourcePromptContent: View {
Button("In person · mic only") { self.controller.selectApplication(nil) }
Divider()
ForEach(sections.usual) { option in
- self.applicationEntry(option, snapshot: snapshot)
+ self.pickerEntry(option, snapshot: snapshot)
}
if !sections.others.isEmpty {
Menu("Other apps") {
ForEach(sections.others) { option in
- self.applicationEntry(option, snapshot: snapshot)
+ self.pickerEntry(option, snapshot: snapshot)
}
}
}
+ Divider()
+ Button("Refresh apps") { self.controller.refresh() }
} label: {
Text(snapshot.defaults.mode == .inRoom ? "In person · mic only" : snapshot.selectedApplication.map(snapshot.applicationLabel) ?? "Choose an app…")
.lineLimit(1).truncationMode(.middle)
@@ -399,6 +405,15 @@ struct MeetingRecordingSourcePromptContent: View {
.disabled(self.controller.isStarting)
}
+ @ViewBuilder
+ private func pickerEntry(_ entry: MeetingAppPickerEntry, snapshot: MeetingRecordingSourceSnapshot) -> some View {
+ if let application = entry.application {
+ self.applicationEntry(MeetingApplicationOption(identity: application), snapshot: snapshot)
+ } else {
+ Button(entry.unavailableLabel) {}.disabled(true)
+ }
+ }
+
private func applicationEntry(_ option: MeetingApplicationOption, snapshot: MeetingRecordingSourceSnapshot) -> some View {
let name = snapshot.applicationLabel(option.identity)
return Button { self.controller.selectApplication(option.identity) } label: {
diff --git a/Sources/Fluid/UI/ReleaseHighlightsContent.swift b/Sources/Fluid/UI/ReleaseHighlightsContent.swift
index a250ad0a..c4292cb9 100644
--- a/Sources/Fluid/UI/ReleaseHighlightsContent.swift
+++ b/Sources/Fluid/UI/ReleaseHighlightsContent.swift
@@ -41,7 +41,7 @@ struct ReleaseHighlightsContent {
destination: .voiceEngine
)
return Self(
- release: "1.6.13-beta.1",
+ release: "1.6.13-beta.2",
title: hasPrivateAI ? "Smarter cleanup, sharper speech" : "Sharper speech",
subtitle: hasPrivateAI
? "Meet Fluid 1.1 Splash and Fluid Speech Pro. Plus Qwen dictation, smoother live captions and faster cleanup on M5 Macs."
diff --git a/Tests/FluidDictationIntegrationTests/MeetingAEC3Tests.swift b/Tests/FluidDictationIntegrationTests/MeetingAEC3Tests.swift
index 0e92f82d..f9eb9ec0 100644
--- a/Tests/FluidDictationIntegrationTests/MeetingAEC3Tests.swift
+++ b/Tests/FluidDictationIntegrationTests/MeetingAEC3Tests.swift
@@ -683,6 +683,44 @@ final class MeetingAEC3Tests: XCTestCase {
))
}
+ func testFailureDuringWarmupStillReportsUnfilteredAudioOnce() async throws {
+ let directory = FileManager.default.temporaryDirectory.appendingPathComponent("aec-warmup-failure-\(UUID())")
+ defer { try? FileManager.default.removeItem(at: directory) }
+ let writer = try MeetingAudioChunkWriter(
+ track: Self.microphoneTrack(), sessionDirectory: directory, chunkDuration: 60, eventHandler: { _ in }
+ )
+ let gate = MeetingMicrophoneTranscriptGate(.unprotected)
+ let live = AECLiveRecorder()
+ let protections = AECProtectionRecorder()
+ let committer = MeetingAECOutputCommitter(
+ writer: writer,
+ transcriptGate: gate,
+ liveAudioHandler: { _, sample in live.append(sample) },
+ protectionChanged: { protections.append($0) },
+ terminalFailure: { _ in }
+ )
+ let processor = AECFakeProcessor()
+ let pipeline = MeetingAECPipeline(processor: processor, committer: committer)
+ for frame in 0..<3 {
+ if frame == 1 { processor.failNext = true }
+ let pts = CMTime(value: CMTimeValue(frame * 480), timescale: 48_000)
+ try pipeline.consumeRender(XCTUnwrap(MeetingAECPCMAdapter.synthesize(
+ samples: [Float](repeating: 0.2, count: 480), presentationTime: pts
+ )), stream: self.token)
+ try pipeline.consumeCapture(XCTUnwrap(MeetingAECPCMAdapter.synthesize(
+ samples: [Float](repeating: 0.1, count: 480), presentationTime: pts
+ )), stream: self.token)
+ await committer.waitForPendingCommits()
+ _ = await writer.snapshot()
+ if frame == 0 { XCTAssertTrue(protections.values.isEmpty) }
+ }
+ XCTAssertEqual(protections.values, [.unfiltered], "a real failure after silent warm-up must still warn, once")
+ XCTAssertEqual(live.count, 3)
+ pipeline.stop(boundary: gate.invalidate())
+ await committer.waitForPendingCommits()
+ _ = await writer.stop()
+ }
+
func testPipelinePromotesOnlyOnFrame201AndBridgeFailureKeepsSpeech() async throws {
let directory = FileManager.default.temporaryDirectory
.appendingPathComponent("fluid-aec3-test-\(UUID().uuidString)", isDirectory: true)
@@ -696,10 +734,12 @@ final class MeetingAEC3Tests: XCTestCase {
let gate = MeetingMicrophoneTranscriptGate(.unprotected)
let live = AECLiveRecorder()
let failures = AECTerminalRecorder()
+ let protections = AECProtectionRecorder()
let committer = MeetingAECOutputCommitter(
writer: writer,
transcriptGate: gate,
liveAudioHandler: { _, sample in live.append(sample) },
+ protectionChanged: { protections.append($0) },
terminalFailure: { failure in failures.append(failure) }
)
let processor = AECFakeProcessor()
@@ -717,9 +757,13 @@ final class MeetingAEC3Tests: XCTestCase {
pipeline.consumeCapture(capture, stream: self.token)
if frame.isMultiple(of: 8) { _ = await writer.snapshot() }
}
+ await committer.waitForPendingCommits()
var track = await writer.snapshot()
- XCTAssertEqual(track.captureEras?.last?.echoProtection, .unprotected)
- XCTAssertEqual(live.count, 0)
+ XCTAssertEqual(track.captureEras?.last?.echoProtection, .unfiltered)
+ XCTAssertNil(track.captureEras?.last?.aecProvenance)
+ XCTAssertTrue(protections.values.isEmpty, "normal warm-up must not announce filtering failure")
+ XCTAssertEqual(live.count, 200, "warm-up must preserve every opening microphone frame")
+ XCTAssertEqual(try live.firstMean(token: self.token), 0.1, accuracy: 0.00_001)
let promotionPTS = CMTime(value: 200 * 480, timescale: 48_000)
try pipeline.consumeRender(XCTUnwrap(MeetingAECPCMAdapter.synthesize(
@@ -732,8 +776,9 @@ final class MeetingAEC3Tests: XCTestCase {
track = await writer.snapshot()
XCTAssertEqual(track.captureEras?.last?.echoProtection, .softwareEchoCancelled)
XCTAssertEqual(track.captureEras?.last?.aecProvenance, MeetingAECConstants.provenance)
- XCTAssertEqual(live.count, 1)
- XCTAssertEqual(try live.firstMean(token: self.token), 0.35, accuracy: 0.00_001)
+ XCTAssertEqual(protections.values, [.softwareEchoCancelled])
+ XCTAssertEqual(live.count, 201)
+ XCTAssertEqual(try live.mean(at: 200, token: self.token), 0.35, accuracy: 0.00_001)
processor.failNext = true
let failurePTS = CMTime(value: 201 * 480, timescale: 48_000)
@@ -752,7 +797,8 @@ final class MeetingAEC3Tests: XCTestCase {
[0, 2, 2.01],
"the demotion era must be ordered after the protected era on the sample timeline"
)
- XCTAssertEqual(live.count, 2, "the bridge-failure frame must reach live ASR with honest unfiltered provenance")
+ XCTAssertEqual(live.count, 202, "the bridge-failure frame must reach live ASR with honest unfiltered provenance")
+ XCTAssertEqual(protections.values, [.softwareEchoCancelled, .unfiltered])
XCTAssertTrue(failures.values.isEmpty)
pipeline.stop(boundary: gate.invalidate())
@@ -1475,6 +1521,13 @@ private final nonisolated class AECFakeProcessor: MeetingAECProcessing, @uncheck
}
}
+private final nonisolated class AECProtectionRecorder: @unchecked Sendable {
+ private let lock = NSLock()
+ private var storage: [MeetingMicrophoneEchoProtection] = []
+ var values: [MeetingMicrophoneEchoProtection] { self.lock.withLock { self.storage } }
+ func append(_ value: MeetingMicrophoneEchoProtection) { self.lock.withLock { self.storage.append(value) } }
+}
+
private final nonisolated class AECLiveRecorder: @unchecked Sendable {
private let lock = NSLock()
private var samples: [CMSampleBuffer] = []
@@ -1490,9 +1543,13 @@ private final nonisolated class AECLiveRecorder: @unchecked Sendable {
}
func firstMean(token: MeetingAECStreamToken) throws -> Float {
+ try self.mean(at: 0, token: token)
+ }
+
+ func mean(at index: Int, token: MeetingAECStreamToken) throws -> Float {
let sample = try self.lock.withLock { () throws -> CMSampleBuffer in
- guard let first = self.samples.first else { throw MeetingAECFailure.invalidSampleBuffer }
- return first
+ guard self.samples.indices.contains(index) else { throw MeetingAECFailure.invalidSampleBuffer }
+ return self.samples[index]
}
let block = try MeetingAECPCMAdapter.extract(sample, kind: .capture, stream: token).get()
return block.samples.reduce(0, +) / Float(block.samples.count)
diff --git a/Tests/FluidDictationIntegrationTests/MeetingAutoDetectorTests.swift b/Tests/FluidDictationIntegrationTests/MeetingAutoDetectorTests.swift
index c0b602d5..fc8d48ad 100644
--- a/Tests/FluidDictationIntegrationTests/MeetingAutoDetectorTests.swift
+++ b/Tests/FluidDictationIntegrationTests/MeetingAutoDetectorTests.swift
@@ -1943,12 +1943,19 @@ final class MeetingAutoDetectorTests: XCTestCase {
let sections = MeetingAppRegistry.pickerSections(apps, bundleIdentifier: \.bundle, name: \.name, isBackgroundItem: \.background)
XCTAssertEqual(
sections.usual.map(\.name),
- ["zoom.us", "Microsoft Teams", "FaceTime", "Slack", "Google Meet", "Google Chrome", "Safari"]
+ ["Google Chrome", "Safari", "zoom.us", "Microsoft Teams", "Google Meet", "FaceTime", "Slack"]
)
XCTAssertEqual(sections.others.map(\.name), ["Finder", "Music", "AirPlayUIAgent", "Control Center"])
XCTAssertEqual(sections.usual.count + sections.others.count, apps.count, "nothing is dropped from the list")
}
+ func testPickerOnlyBrowsersDoNotEnableAutomaticDetection() {
+ for bundle in ["org.mozilla.firefox", "com.duckduckgo.macos.browser"] {
+ XCTAssertNotNil(MeetingAppRegistry.pickerRank(forBundleIdentifier: bundle))
+ XCTAssertNil(MeetingAppRegistry.tier(forBundleIdentifier: bundle))
+ }
+ }
+
func testAppsThatOnlyShapeThePickerAreNeverDetected() {
for bundle in MeetingAppRegistry.otherCallAppBundleIdentifiers {
XCTAssertNil(MeetingAppRegistry.tier(forBundleIdentifier: bundle), bundle)
diff --git a/Tests/FluidDictationIntegrationTests/MeetingParakeetNemotronBackendTests.swift b/Tests/FluidDictationIntegrationTests/MeetingParakeetNemotronBackendTests.swift
index dd92cce9..b0bbd4c7 100644
--- a/Tests/FluidDictationIntegrationTests/MeetingParakeetNemotronBackendTests.swift
+++ b/Tests/FluidDictationIntegrationTests/MeetingParakeetNemotronBackendTests.swift
@@ -944,6 +944,71 @@ final class MeetingParakeetNemotronBackendTests: XCTestCase {
XCTAssertEqual(assembled.sidecar.speakerIdentityLinks.count, 1)
}
+ func testASRPaddingPreservesInputAndDoesNotInventEmptyAudio() {
+ let short: [Float] = [0.25, -0.5, 0.75]
+ let padded = MeetingParakeetNemotronBackend.asrInput(short)
+ XCTAssertEqual(Array(padded.prefix(short.count)), short)
+ XCTAssertEqual(padded.count, 16_000)
+ XCTAssertTrue(padded.dropFirst(short.count).allSatisfy { $0 == 0 })
+ XCTAssertEqual(short, [0.25, -0.5, 0.75])
+ XCTAssertTrue(MeetingParakeetNemotronBackend.asrInput([]).isEmpty)
+ for count in [16_000, 16_001] {
+ let input = [Float](repeating: 0.25, count: count)
+ XCTAssertEqual(MeetingParakeetNemotronBackend.asrInput(input), input)
+ }
+ }
+
+ func testWordsEntirelyInPaddingDoNotReturnAsUntimedText() async throws {
+ let duration = 0.05
+ let chunk = self.makePCMChunk(sequence: 0, start: 100, end: 100 + duration)
+ let track = self.makeMicTrack(chunks: [chunk], eraStart: 100)
+ let session = self.makeSession(mode: .inRoom, tracks: [track])
+ let runtime = FakeRuntime()
+ runtime.asrSession.minimumSampleCount = 16_000
+ runtime.asrSession.responses = [
+ .init(text: "phantom word", words: [
+ ASRWordTiming(text: "phantom", start: 0.6, end: 0.7),
+ ASRWordTiming(text: "word", start: 0.7, end: 0.8),
+ ]),
+ ]
+ let backend = self.makeBackend(runtime: runtime, materializer: FakeMaterializer())
+ let plan = try backend.plan(self.makeRequest(session: session, directory: self.makeTempSessionDirectory()))
+ let manifest = try self.makeManifest(plan: plan, observations: [
+ MeetingAnalysisChunkKey(trackID: track.id, chunkID: chunk.id): self.makeObserved(chunk, duration: duration),
+ ])
+ let outcome = try await backend.execute(plan: plan, manifest: manifest, progress: { _ in })
+ guard case let .canonicalEvidence(bundle) = outcome else { return XCTFail("Expected canonical evidence") }
+ XCTAssertEqual(runtime.asrSession.callSampleCounts, [16_000])
+ XCTAssertTrue(bundle.coverageReceipts.allSatisfy { $0.status == .processed })
+ XCTAssertTrue(bundle.evidence.units.isEmpty, "Rejected timed words must never be reintroduced as a whole-clip utterance")
+ }
+
+ func testSubsecondEpochPadsInferenceWithoutExtendingTranscriptCoverage() async throws {
+ let duration = 0.05
+ let chunk = self.makePCMChunk(sequence: 0, start: 100, end: 100 + duration)
+ let track = self.makeMicTrack(chunks: [chunk], eraStart: 100)
+ let session = self.makeSession(mode: .inRoom, tracks: [track])
+ let runtime = FakeRuntime()
+ runtime.asrSession.minimumSampleCount = 16_000
+ runtime.asrSession.responses = [
+ .init(text: "short padding", words: [
+ ASRWordTiming(text: "short", start: 0.005, end: 0.035),
+ ASRWordTiming(text: "padding", start: 0.6, end: 0.7),
+ ]),
+ ]
+ let backend = self.makeBackend(runtime: runtime, materializer: FakeMaterializer())
+ let plan = try backend.plan(self.makeRequest(session: session, directory: self.makeTempSessionDirectory()))
+ let manifest = try self.makeManifest(plan: plan, observations: [
+ MeetingAnalysisChunkKey(trackID: track.id, chunkID: chunk.id): self.makeObserved(chunk, duration: duration),
+ ])
+ let outcome = try await backend.execute(plan: plan, manifest: manifest, progress: { _ in })
+ guard case let .canonicalEvidence(bundle) = outcome else { return XCTFail("Expected canonical evidence") }
+ XCTAssertEqual(runtime.asrSession.callSampleCounts, [16_000])
+ XCTAssertTrue(bundle.coverageReceipts.allSatisfy { $0.status == .processed })
+ XCTAssertEqual(bundle.evidence.units.map(\.text), ["short"])
+ XCTAssertTrue(bundle.coverageReceipts.allSatisfy { $0.analysisEnd <= 0.050_001 })
+ }
+
func testPCMFirstEpochMaterializesOnceForBothModelPhases() async throws {
let chunk = self.makePCMChunk(sequence: 0, start: 100, end: 101)
let track = self.makeMicTrack(chunks: [chunk], eraStart: 100)
@@ -1583,6 +1648,7 @@ private final nonisolated class FakeASRSession: MeetingParakeetASRSession, @unch
var responses: [Response] = []
var failingCallIndices: Set<Int> = []
+ var minimumSampleCount = 0
var cancellationCallIndices: Set<Int> = []
var latch: Latch?
var onCall: (() -> Void)?
@@ -1596,7 +1662,7 @@ private final nonisolated class FakeASRSession: MeetingParakeetASRSession, @unch
self.onCall?()
if let latch { await latch.wait() }
if self.cancellationCallIndices.contains(index) { throw CancellationError() }
- if self.failingCallIndices.contains(index) {
+ if self.failingCallIndices.contains(index) || samples.count < self.minimumSampleCount {
throw MeetingEpochMaterializationError.unreadable(spanID: "fake-asr-failure")
}
let response = index < self.responses.count ? self.responses[index] : Response(text: "", words: [])
diff --git a/Tests/FluidDictationIntegrationTests/MeetingRecordingSourceTests.swift b/Tests/FluidDictationIntegrationTests/MeetingRecordingSourceTests.swift
index 9090a598..752d547b 100644
--- a/Tests/FluidDictationIntegrationTests/MeetingRecordingSourceTests.swift
+++ b/Tests/FluidDictationIntegrationTests/MeetingRecordingSourceTests.swift
@@ -35,6 +35,32 @@ final class MeetingRecordingSourceTests: XCTestCase {
)
}
+ func testInstalledPickerAppsStayVisibleWithoutBecomingCaptureTargets() {
+ let chrome = MeetingApplicationIdentity(bundleIdentifier: "com.google.Chrome", processID: 100, displayName: "Chrome")
+ let entries = MeetingAppPickerEntry.entries(applications: [chrome], installed: [
+ .init(bundleIdentifier: "com.google.Chrome", displayName: "Chrome", isRunning: true),
+ .init(bundleIdentifier: "com.apple.Safari", displayName: "Safari"),
+ .init(bundleIdentifier: "com.apple.iChat", displayName: "Messages", isRunning: true),
+ .init(bundleIdentifier: "com.apple.Safari", displayName: "Safari duplicate"),
+ ])
+ XCTAssertEqual(entries.count, 3)
+ XCTAssertEqual(entries[0].application, chrome)
+ XCTAssertNil(entries[1].application)
+ XCTAssertEqual(entries[1].unavailableLabel, "Safari · Not running")
+ XCTAssertNil(entries[2].application)
+ XCTAssertEqual(entries[2].unavailableLabel, "Messages · Not available")
+ XCTAssertFalse(entries.contains { $0.bundleIdentifier == "us.zoom.xos" }, "never invent an uninstalled app")
+ XCTAssertTrue(MeetingAppPickerEntry.entries(applications: [], installed: []).isEmpty)
+ }
+
+ func testPickerPreservesSeparateRunningProcessesForTheSameApp() {
+ let first = MeetingApplicationIdentity(bundleIdentifier: "browser", processID: 1, displayName: "Browser")
+ let second = MeetingApplicationIdentity(bundleIdentifier: "browser", processID: 2, displayName: "Browser")
+ let entries = MeetingAppPickerEntry.entries(applications: [first, second], installed: [])
+ XCTAssertEqual(entries.compactMap(\.application), [first, second])
+ XCTAssertEqual(Set(entries.map(\.id)).count, 2)
+ }
+
func testMicrophoneLabelWhenNoDevicesAreAvailable() {
var snapshot = self.snapshot()
snapshot.microphones = MeetingMicrophoneCatalogSnapshot(identities: [], defaultCoreAudioUID: nil)