From 50d6c96383a45b5e1c520468f6cd62551e1f49da Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期一, 21 八月 2023 15:58:58 +0800
Subject: [PATCH] Fix bug for mp4 in h5 (#882)
---
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