From fe669c3f6fb5eb0e258fa92700211282bfadd814 Mon Sep 17 00:00:00 2001 From: Theo Weijmer Date: Thu, 1 Oct 2026 10:53:00 +0200 Subject: [PATCH] fix: probe loads model before recording and shows signal levels Co-Authored-By: Claude Sonnet 5.5 --- Sources/SstProbe/TranscribeProbe.swift | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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..