From 82cd3980eca7cc896c4b276ed4d43520c6265239 Mon Sep 17 00:00:00 2001
From: Cw <cw@git.boborobots.com>
Date: Mon, 13 Jul 2026 16:02:26 +0800
Subject: [PATCH] Fix Windows ASR model paths for non-ASCII users

---
 C1.source/privatevoice.src/internal/engine/engine.go |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/C1.source/privatevoice.src/internal/engine/engine.go b/C1.source/privatevoice.src/internal/engine/engine.go
index aed8e7f..037efc5 100755
--- a/C1.source/privatevoice.src/internal/engine/engine.go
+++ b/C1.source/privatevoice.src/internal/engine/engine.go
@@ -21,6 +21,12 @@
 	Close()
 }
 
+// ProviderEngine is implemented by engines that can report the concrete
+// sherpa/onnxruntime provider selected at initialization time.
+type ProviderEngine interface {
+	Provider() string
+}
+
 // StreamingEngine is implemented by engines that can expose partial results
 // while audio is still being captured.
 type StreamingEngine interface {
@@ -116,6 +122,14 @@
 	return newPlatformEngine(resolved)
 }
 
+func audioDurationMS(samples []float32) int64 {
+	return int64(len(samples)) * 1000 / 16000
+}
+
+func durationMS(duration time.Duration) int64 {
+	return duration.Milliseconds()
+}
+
 func isSupportedBackend(backend string) bool {
 	switch backend {
 	case model.BackendSenseVoice, model.BackendMoonshine, model.BackendTransducer, model.BackendNemoTransducer, model.BackendQwen3ASR, model.BackendXASRStreaming:

--
Gitblit v1.9.3