feat: add WhisperKit transcriber and transcribe probe
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
let started = Date.now
|
||||
let text = try await transcriber.transcribe(samples)
|
||||
let elapsed = Date.now.timeIntervalSince(started)
|
||||
print(String(format: "(%.2f s) ", elapsed) + text)
|
||||
} catch {
|
||||
print("mislukt:", error.localizedDescription)
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ case "hotkey":
|
||||
runHotkeyProbe()
|
||||
case "record":
|
||||
await runRecordProbe()
|
||||
case "transcribe":
|
||||
await runTranscribeProbe()
|
||||
default:
|
||||
print("usage: sst-probe hotkey|record")
|
||||
print("usage: sst-probe hotkey|record|transcribe")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user