From bdd365c81f6a0e6432c970e84ae369ae7f2be393 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期三, 10 五月 2023 10:03:19 +0800
Subject: [PATCH] Merge pull request #483 from zhuzizyf/main
---
funasr/runtime/onnxruntime/src/e2e-vad.h | 3 ++-
funasr/runtime/onnxruntime/src/online-feature.h | 1 +
funasr/runtime/onnxruntime/src/online-feature.cpp | 1 +
3 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/e2e-vad.h b/funasr/runtime/onnxruntime/src/e2e-vad.h
index e9a8293..5ece1f8 100644
--- a/funasr/runtime/onnxruntime/src/e2e-vad.h
+++ b/funasr/runtime/onnxruntime/src/e2e-vad.h
@@ -1,6 +1,7 @@
/**
* 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
@@ -442,7 +443,7 @@
} else {
data_buf_all_size += waveform.size();
}
- for (int offset = 0; offset < waveform.size() - frame_sample_length + 1; offset += frame_shift_length) {
+ for (int offset = 0; offset + frame_sample_length -1 < waveform.size(); offset += frame_shift_length) {
float sum = 0.0;
for (int i = 0; i < frame_sample_length; i++) {
sum += waveform[offset + i] * waveform[offset + i];
diff --git a/funasr/runtime/onnxruntime/src/online-feature.cpp b/funasr/runtime/onnxruntime/src/online-feature.cpp
index c5caf0a..a21589c 100644
--- a/funasr/runtime/onnxruntime/src/online-feature.cpp
+++ b/funasr/runtime/onnxruntime/src/online-feature.cpp
@@ -1,6 +1,7 @@
/**
* Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
* MIT License (https://opensource.org/licenses/MIT)
+ * Contributed by zhuzizyf(China Telecom).
*/
#include "online-feature.h"
diff --git a/funasr/runtime/onnxruntime/src/online-feature.h b/funasr/runtime/onnxruntime/src/online-feature.h
index 7347056..16e6e4b 100644
--- a/funasr/runtime/onnxruntime/src/online-feature.h
+++ b/funasr/runtime/onnxruntime/src/online-feature.h
@@ -1,6 +1,7 @@
/**
* 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>
--
Gitblit v1.9.1