From adcc48f6d2ad4c19cfd5586b9566137c401357ed Mon Sep 17 00:00:00 2001
From: Yabin Li <wucong.lyb@alibaba-inc.com>
Date: 星期日, 20 八月 2023 22:12:36 +0800
Subject: [PATCH] Update SDK_advanced_guide_online_zh.md
---
funasr/runtime/onnxruntime/bin/funasr-onnx-offline.cpp | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/funasr/runtime/onnxruntime/bin/funasr-onnx-offline.cpp b/funasr/runtime/onnxruntime/bin/funasr-onnx-offline.cpp
index 82668f8..c43fd8d 100644
--- a/funasr/runtime/onnxruntime/bin/funasr-onnx-offline.cpp
+++ b/funasr/runtime/onnxruntime/bin/funasr-onnx-offline.cpp
@@ -91,11 +91,8 @@
vector<string> wav_ids;
string default_id = "wav_default_id";
string wav_path_ = model_path.at(WAV_PATH);
- if(is_target_file(wav_path_, "wav") || is_target_file(wav_path_, "pcm")){
- wav_list.emplace_back(wav_path_);
- wav_ids.emplace_back(default_id);
- }
- else if(is_target_file(wav_path_, "scp")){
+
+ if(is_target_file(wav_path_, "scp")){
ifstream in(wav_path_);
if (!in.is_open()) {
LOG(ERROR) << "Failed to open file: " << model_path.at(WAV_SCP) ;
@@ -112,8 +109,8 @@
}
in.close();
}else{
- LOG(ERROR)<<"Please check the wav extension!";
- exit(-1);
+ wav_list.emplace_back(wav_path_);
+ wav_ids.emplace_back(default_id);
}
float snippet_time = 0.0f;
@@ -131,6 +128,10 @@
{
string msg = FunASRGetResult(result, 0);
LOG(INFO)<< wav_id <<" : "<<msg;
+ string stamp = FunASRGetStamp(result);
+ if(stamp !=""){
+ LOG(INFO)<< wav_id <<" : "<<stamp;
+ }
snippet_time += FunASRGetRetSnippetTime(result);
FunASRFreeResult(result);
}
--
Gitblit v1.9.1