From a4d0724b27c8a1bc1df1f659c8c763813d23ff8c Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 01 九月 2023 22:46:46 +0800
Subject: [PATCH] docs
---
funasr/runtime/onnxruntime/src/audio.cpp | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/audio.cpp b/funasr/runtime/onnxruntime/src/audio.cpp
index 2ba9c30..6335f4e 100644
--- a/funasr/runtime/onnxruntime/src/audio.cpp
+++ b/funasr/runtime/onnxruntime/src/audio.cpp
@@ -980,6 +980,23 @@
}
}
+int Audio::Fetch(float *&dout, int &len, int &flag, float &start_time)
+{
+ if (frame_queue.size() > 0) {
+ AudioFrame *frame = frame_queue.front();
+ frame_queue.pop();
+
+ start_time = (float)(frame->GetStart())/MODEL_SAMPLE_RATE;
+ dout = speech_data + frame->GetStart();
+ len = frame->GetLen();
+ delete frame;
+ flag = S_END;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
void Audio::Padding()
{
float num_samples = speech_len;
@@ -1146,8 +1163,8 @@
}else if(speech_end_i != -1){ // [-1,100]
if(speech_start == -1 or speech_offline_start == -1){
- LOG(ERROR) <<"Vad start is null while vad end is available." ;
- exit(-1);
+ LOG(ERROR) <<"Vad start is null while vad end is available. Set vad start 0" ;
+ speech_start = 0;
}
int start = speech_start*seg_sample;
--
Gitblit v1.9.1