Files
OSGKeyboard/OSGKeyboardHostSupport/Services/ASRChunkTranscribing.swift
Rocky 9f308fadd2 feat(keyboard): ship AI hint carousel, home library cards, and clipboard polish
Rotate AI idle suggestions with optional remote packs, move history/dictionary onto self-sizing Home preview cards, harden clipboard capture/prompting, and simplify keyboard chrome by dropping most liquid-glass shadows.
2026-08-13 01:00:51 +08:00

29 lines
764 B
Swift

// ASRChunkTranscribing.swift
// OSGKeyboard · HostSupport
//
// Minimal ASR surface for pipelined utterance chunking. Keeps
// `ChunkedUtterancePipeline` independent of iOS-only `SpeechAnalyzer`.
import Foundation
#if canImport(OSGKeyboardShared)
import OSGKeyboardShared
#endif
public enum ASRChunkResult: Sendable, Equatable {
case success(String)
case failure(String)
case cancelled
}
/// One-shot chunk transcription used by `ChunkedUtterancePipeline`.
public protocol ASRChunkTranscribing: Sendable {
func transcribeChunk(samples: [Float], locale: Locale) async -> ASRChunkResult
func cancel()
func resetForNewUtterance()
}
extension ASRChunkTranscribing {
public func cancel() {}
public func resetForNewUtterance() {}
}