From 9c0fa3c0a435478fe0b36810cfc5ca273d4593f7 Mon Sep 17 00:00:00 2001
From: nichongjia-2007 <nichongjia@gmail.com>
Date: 星期二, 11 七月 2023 17:36:22 +0800
Subject: [PATCH] Merge branch 'main' of https://github.com/alibaba-damo-academy/FunASR
---
funasr/runtime/onnxruntime/bin/funasr-onnx-offline.cpp | 11 ++++-------
1 files changed, 4 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..caa8605 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;
--
Gitblit v1.9.1