From 42e1259075e6cf75c41a2c1826c6af92c353a71f Mon Sep 17 00:00:00 2001
From: wucong.lyb <wucong.lyb@alibaba-inc.com>
Date: 星期一, 22 五月 2023 19:09:30 +0800
Subject: [PATCH] fix lm_inference_launch.py
---
funasr/runtime/onnxruntime/src/online-feature.h | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/online-feature.h b/funasr/runtime/onnxruntime/src/online-feature.h
index abe9587..16e6e4b 100644
--- a/funasr/runtime/onnxruntime/src/online-feature.h
+++ b/funasr/runtime/onnxruntime/src/online-feature.h
@@ -1,9 +1,14 @@
-
+/**
+ * Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
+ * MIT License (https://opensource.org/licenses/MIT)
+ * Contributed by zhuzizyf(China Telecom).
+*/
+#pragma once
#include <vector>
#include "precomp.h"
using namespace std;
-
+namespace funasr {
class OnlineFeature {
public:
@@ -12,15 +17,12 @@
void ExtractFeats(vector<vector<float>> &vad_feats, vector<float> waves, bool input_finished);
-
private:
void OnlineFbank(vector<vector<float>> &vad_feats, vector<float> &waves);
-
int OnlineLfrCmvn(vector<vector<float>> &vad_feats);
-
+
static int ComputeFrameNum(int sample_length, int frame_sample_length, int frame_shift_sample_length) {
int frame_num = static_cast<int>((sample_length - frame_sample_length) / frame_shift_sample_length + 1);
-
if (frame_num >= 1 && sample_length >= frame_sample_length)
return frame_num;
else
@@ -52,3 +54,5 @@
bool input_finished_ = false;
};
+
+} // namespace funasr
--
Gitblit v1.9.1