From e24dbdc496debec225414d4d2c760f5775e64f2a Mon Sep 17 00:00:00 2001
From: 天地 <tiandiweizun@gmail.com>
Date: 星期三, 26 三月 2025 13:44:41 +0800
Subject: [PATCH] 感觉应该从文件读取更合适,因为上面判断了文件存在,且可以读取,如果本身是文本的话,下面也会有逻辑进行处理 (#2452)

---
 runtime/csharp/AliFsmnVad/AliFsmnVadSharp/AliFsmnVad.cs |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/runtime/csharp/AliFsmnVad/AliFsmnVadSharp/AliFsmnVad.cs b/runtime/csharp/AliFsmnVad/AliFsmnVadSharp/AliFsmnVad.cs
index 672eac2..aad8bf5 100644
--- a/runtime/csharp/AliFsmnVad/AliFsmnVadSharp/AliFsmnVad.cs
+++ b/runtime/csharp/AliFsmnVad/AliFsmnVadSharp/AliFsmnVad.cs
@@ -4,6 +4,8 @@
 using Microsoft.ML.OnnxRuntime;
 using Microsoft.ML.OnnxRuntime.Tensors;
 
+// 妯″瀷鏂囦欢涓嬭浇鍦板潃锛歨ttps://modelscope.cn/models/iic/speech_fsmn_vad_zh-cn-16k-common-onnx/
+
 namespace AliFsmnVadSharp
 {
     public class AliFsmnVad : IDisposable
@@ -28,9 +30,9 @@
             VadYamlEntity vadYamlEntity = YamlHelper.ReadYaml<VadYamlEntity>(configFilePath);
             _wavFrontend = new WavFrontend(mvnFilePath, vadYamlEntity.frontend_conf);
             _frontend = vadYamlEntity.frontend;
-            _vad_post_conf = vadYamlEntity.vad_post_conf;
+            _vad_post_conf = vadYamlEntity.model_conf;
             _batchSize = batchSize;
-            _max_end_sil = _max_end_sil != int.MinValue ? _max_end_sil : vadYamlEntity.vad_post_conf.max_end_silence_time;
+            _max_end_sil = _max_end_sil != int.MinValue ? _max_end_sil : vadYamlEntity.model_conf.max_end_silence_time;
             _encoderConfEntity = vadYamlEntity.encoder_conf;
 
             ILoggerFactory loggerFactory = new LoggerFactory();

--
Gitblit v1.9.1