feat(flow): add whole-utterance batch ASR fallback (P1)
- Accumulate utterance PCM in FlowContinuousCapture for batch retry - Run full-utterance transcribeChunk when stitched final lags partial - Refactor Mac MLX tail drain to shared FlowUtteranceEndCoordinator - Add FlowUtterancePCMStore, UtteranceBatchFallbackPolicy, and tests Co-authored-by: Rocky <hkgood@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// FlowUtterancePCMStoreTests.swift
|
||||
// OSGKeyboardTests
|
||||
|
||||
import XCTest
|
||||
@testable import OSGKeyboardShared
|
||||
|
||||
final class FlowUtterancePCMStoreTests: XCTestCase {
|
||||
|
||||
func testAppendAndConsume() {
|
||||
let store = FlowUtterancePCMStore(maxSampleCount: 100)
|
||||
store.append([1, 2, 3])
|
||||
store.append([4, 5])
|
||||
XCTAssertEqual(store.sampleCount, 5)
|
||||
XCTAssertEqual(store.consume(), [1, 2, 3, 4, 5])
|
||||
XCTAssertEqual(store.sampleCount, 0)
|
||||
}
|
||||
|
||||
func testTrimsOldestWhenOverCap() {
|
||||
let store = FlowUtterancePCMStore(maxSampleCount: 4)
|
||||
store.append([1, 2, 3, 4, 5])
|
||||
XCTAssertEqual(store.consume(), [2, 3, 4, 5])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user