From ac786054dedc55e0b687f686aa6c24fa96bdb9b8 Mon Sep 17 00:00:00 2001
From: yhliang <68215459+yhliang-aslp@users.noreply.github.com>
Date: 星期四, 18 五月 2023 11:02:02 +0800
Subject: [PATCH] Merge pull request #524 from alibaba-damo-academy/main

---
 funasr/runtime/onnxruntime/src/paraformer.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/funasr/runtime/onnxruntime/src/paraformer.cpp b/funasr/runtime/onnxruntime/src/paraformer.cpp
index 74366a0..1957a12 100644
--- a/funasr/runtime/onnxruntime/src/paraformer.cpp
+++ b/funasr/runtime/onnxruntime/src/paraformer.cpp
@@ -69,7 +69,11 @@
 
 vector<float> Paraformer::FbankKaldi(float sample_rate, const float* waves, int len) {
     knf::OnlineFbank fbank_(fbank_opts);
-    fbank_.AcceptWaveform(sample_rate, waves, len);
+    std::vector<float> buf(len);
+    for (int32_t i = 0; i != len; ++i) {
+        buf[i] = waves[i] * 32768;
+    }
+    fbank_.AcceptWaveform(sample_rate, buf.data(), buf.size());
     //fbank_->InputFinished();
     int32_t frames = fbank_.NumFramesReady();
     int32_t feature_dim = fbank_opts.mel_opts.num_bins;

--
Gitblit v1.9.1