Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
infinite42
2025-07-17 12:32:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-07-17 12:32:43 +0800
Commit
dfe00f78d9e446b4be915cc511c9a518e4c4c70a
dfe00f78
1 parent
5d28239c
add tail padding for sherpa-onnx-vad-with-online-asr (#2408)
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
4 行增加
和
0 行删除
sherpa-onnx/csrc/sherpa-onnx-vad-with-online-asr.cc
sherpa-onnx/csrc/sherpa-onnx-vad-with-online-asr.cc
查看文件 @
dfe00f7
...
...
@@ -138,6 +138,9 @@ for a list of pre-trained models to download.
samples
=
std
::
move
(
out_samples
);
fprintf
(
stderr
,
"Resampling done
\n
"
);
}
const
float
tail_padding_len
=
1.28
;
// related to model chunk-size
std
::
vector
<
float
>
tail_paddings
(
static_cast
<
int
>
(
tail_padding_len
*
16000
));
fprintf
(
stderr
,
"Started!
\n
"
);
int32_t
window_size
=
vad_config
.
ten_vad
.
model
.
empty
()
...
...
@@ -168,6 +171,7 @@ for a list of pre-trained models to download.
float
end_time
=
start_time
+
duration
;
auto
s
=
recognizer
.
CreateStream
();
s
->
AcceptWaveform
(
16000
,
segment
.
samples
.
data
(),
segment
.
samples
.
size
());
s
->
AcceptWaveform
(
16000
,
tail_paddings
.
data
(),
tail_paddings
.
size
());
s
->
InputFinished
();
while
(
recognizer
.
IsReady
(
s
.
get
()))
{
recognizer
.
DecodeStream
(
s
.
get
());
...
...
请
注册
或
登录
后发表评论