From d3c96905686604aecac5df92f543786174b840f8 Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期二, 19 十二月 2023 20:15:08 +0800
Subject: [PATCH] remove the wavfile parsing for clients

---
 runtime/websocket/bin/funasr-wss-server-2pass.cpp |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/runtime/websocket/bin/funasr-wss-server-2pass.cpp b/runtime/websocket/bin/funasr-wss-server-2pass.cpp
index 89fe16b..965f2a8 100644
--- a/runtime/websocket/bin/funasr-wss-server-2pass.cpp
+++ b/runtime/websocket/bin/funasr-wss-server-2pass.cpp
@@ -25,6 +25,10 @@
 }
 
 int main(int argc, char* argv[]) {
+#ifdef _WIN32
+  #include <windows.h>
+  SetConsoleOutputCP(65001);
+#endif
   try {
     google::InitGoogleLogging(argv[0]);
     FLAGS_logtostderr = true;
@@ -234,6 +238,16 @@
         std::string down_asr_path;
         std::string down_asr_model;
 
+        size_t found = s_offline_asr_path.find("speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404");
+        if (found != std::string::npos) {
+            model_path["offline-model-revision"]="v1.2.4";
+        } else{
+            found = s_offline_asr_path.find("speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404");
+            if (found != std::string::npos) {
+                model_path["offline-model-revision"]="v1.0.5";
+            }
+        }
+
         if (access(s_offline_asr_path.c_str(), F_OK) == 0) {
           // local
           python_cmd_asr = python_cmd + " --model-name " + s_offline_asr_path +
@@ -242,16 +256,6 @@
           down_asr_path = s_offline_asr_path;
         } 
         else {
-          size_t found = s_offline_asr_path.find("speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404");
-          if (found != std::string::npos) {
-              model_path["offline-model-revision"]="v1.2.4";
-          } else{
-              found = s_offline_asr_path.find("speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404");
-              if (found != std::string::npos) {
-                  model_path["offline-model-revision"]="v1.0.5";
-              }
-          }
-
           // modelscope
           LOG(INFO) << "Download model: " << s_offline_asr_path
                     << " from modelscope : "; 

--
Gitblit v1.9.1