From 810046e3df4910c8f5c1a90e4b53aca45b3397e8 Mon Sep 17 00:00:00 2001
From: wuhongsheng <664116298@qq.com>
Date: 星期一, 01 七月 2024 10:42:58 +0800
Subject: [PATCH] 优化merge segments 参数,解决新闻联播男女主持人“晚上好”合并一个speakid问题 (#1861)
---
runtime/onnxruntime/src/audio.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/runtime/onnxruntime/src/audio.cpp b/runtime/onnxruntime/src/audio.cpp
index a5a44ca..22a9ecd 100644
--- a/runtime/onnxruntime/src/audio.cpp
+++ b/runtime/onnxruntime/src/audio.cpp
@@ -1061,8 +1061,9 @@
#ifdef USE_GPU
max_batch = batch_size;
#endif
+ max_batch = std::min(max_batch, (int)frame_queue.size());
- for(int idx=0; idx < std::min(max_batch, (int)frame_queue.size()); idx++){
+ for(int idx=0; idx < max_batch; idx++){
AudioFrame *frame = frame_queue.front();
int length = frame->GetLen();
if(length >= max_sent){
--
Gitblit v1.9.1