Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doxygen/pocketsphinx_batch.1
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ Silence word transition probability
.B \-smoothspec
Write out cepstral-smoothed logspectral files
.TP
.B \-stream_reset
Reset noise-removal statistics before each control-file entry, for control files whose entries are independent recordings
.TP
.B \-svspec
specification (e.g., 24,0-11/25,12-23/26-38 or 0-12/13-25/26-38)
.TP
Expand Down
7 changes: 7 additions & 0 deletions programs/pocketsphinx_batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ static const ps_arg_t ps_args_def[] = {
ARG_INTEGER,
"1",
"Do every Nth line in the control file" },
{ "stream_reset",
ARG_BOOLEAN,
"no",
"Reset noise-removal statistics before each control-file entry, for control files whose entries are independent recordings" },
{ "mllrctl",
ARG_STRING,
NULL,
Expand Down Expand Up @@ -836,6 +840,9 @@ process_ctl(ps_decoder_t *ps, cmd_ln_t *config, FILE *ctlfh)
E_INFO("Decoding '%s'\n", uttid);

/* Do actual decoding. */
if (ps_config_bool(config, "stream_reset")
&& ps_config_bool(config, "remove_noise"))
ps_start_stream(ps);
if(process_mllrctl_line(ps, config, mllrfile) < 0)
continue;
if(process_lmnamectl_line(ps, config, lmname) < 0)
Expand Down
1 change: 1 addition & 0 deletions test/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set(TESTS
test-lm.sh
test-lm-convert.sh
test-main.sh
test-batch-stream-reset.sh
test-main-align.sh
test-align.sh
test-tidigits-fsg.sh
Expand Down
39 changes: 39 additions & 0 deletions test/regression/test-batch-stream-reset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

: ${CMAKE_BINARY_DIR:=$(pwd)}
. ${CMAKE_BINARY_DIR}/test/testfuncs.sh

bn=`basename $0 .sh`
ctl=$bn.ctl

echo "Test: $bn"

printf 'goforward 0 -1 gof_first\nnumbers 0 -1 num\nsomething 0 -1 som\ngoforward 0 -1 gof_again\n' >$ctl
rm -f $bn.hyp

run_program pocketsphinx_batch \
-hmm $model/en-us/en-us \
-lm $model/en-us/en-us.lm.bin \
-dict $model/en-us/cmudict-en-us.dict \
-ctl $ctl \
-cepdir $data \
-cepext .raw \
-adcin yes \
-stream_reset yes \
-hyp $bn.hyp \
2>$bn.log

if [ $? = 0 ]; then
pass "run"
else
fail "run"
fi

first=`grep ' (gof_first ' $bn.hyp 2>/dev/null | sed 's/ (gof_first / (gof /'`
again=`grep ' (gof_again ' $bn.hyp 2>/dev/null | sed 's/ (gof_again / (gof /'`

if test -n "$first" && test "$first" = "$again"; then
pass "repeated entry"
else
fail "repeated entry"
fi