diff --git a/Sources/SstProbe/TranscribeProbe.swift b/Sources/SstProbe/TranscribeProbe.swift index aed61b6..f678751 100644 --- a/Sources/SstProbe/TranscribeProbe.swift +++ b/Sources/SstProbe/TranscribeProbe.swift @@ -2,11 +2,29 @@ import Foundation import SstWhisper func runTranscribeProbe() async { - guard let samples = await recordSamples(seconds: 6) else { return } print("Model laden (eerste keer: download ≈1.5 GB)…") let transcriber = WhisperKitTranscriber() do { try await transcriber.load() + } catch { + print("mislukt:", error.localizedDescription) + return + } + print("Model klaar.") + for i in [3, 2, 1] { + print("\(i)...") + try? await Task.sleep(for: .seconds(1)) + } + guard let samples = await recordSamples(seconds: 8) else { return } + let peak = samples.map { abs($0) }.max() ?? 0 + print("samples: \(samples.count), piek: \(peak)") + let perSecond = stride(from: 0, to: samples.count, by: 16_000).map { start -> String in + let chunk = samples[start..