Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

647 B
Raw Blame
import AVFoundation

struct CloudHeard: Equatable, Sendable {}

final class CloudStream: RecognitionStream, @unchecked Sendable {
    typealias Hear = @MainActor @Sendable (_ wav: Data, _ seconds: Double) async -> CloudHeard?
    let format = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 16000, channels: 1, interleaved: false)!
    let results = AsyncThrowingStream<Recognition.Piece, Error> { $0.finish() }
    init(format: AVAudioFormat? = nil, hear: @escaping Hear) {}
    func append(_ buffer: AVAudioPCMBuffer) {}
    func finalize(through seconds: Double) async throws {}
    func finish() async {}
    func cancel() async {}
}