From fbd9fbbde066a483fb903fe9c6c76fb95bc6fc2b Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期四, 17 八月 2023 17:13:37 +0800
Subject: [PATCH] update timestamp
---
funasr/runtime/onnxruntime/src/audio.cpp | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/audio.cpp b/funasr/runtime/onnxruntime/src/audio.cpp
index 2ba9c30..a882078 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;
--
Gitblit v1.9.1