Add JS test for streaming + metadata
This commit is contained in:
parent
b0e0972b78
commit
a02eddec38
@ -134,6 +134,11 @@ if (!args['stream']) {
|
||||
stream.feedAudioContent(chunk);
|
||||
});
|
||||
conversionStream.on('end', () => {
|
||||
console.log(stream.finishStream());
|
||||
if (args['extended']) {
|
||||
let metadata = stream.finishStreamWithMetadata();
|
||||
console.log(candidateTranscriptToString(metadata.transcripts[0]));
|
||||
} else {
|
||||
console.log(stream.finishStream());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -519,6 +519,12 @@ run_js_streaming_inference_tests()
|
||||
status=$?
|
||||
set -e
|
||||
assert_correct_ldc93s1_lm "${phrase_pbmodel_withlm}" "$status"
|
||||
|
||||
set +e
|
||||
phrase_pbmodel_withlm=$(deepspeech --model ${TASKCLUSTER_TMP_DIR}/${model_name_mmap} --scorer ${TASKCLUSTER_TMP_DIR}/kenlm.scorer --audio ${TASKCLUSTER_TMP_DIR}/${ldc93s1_sample_filename} --stream --extended 2>${TASKCLUSTER_TMP_DIR}/stderr | tail -n 1)
|
||||
status=$?
|
||||
set -e
|
||||
assert_correct_ldc93s1_lm "${phrase_pbmodel_withlm}" "$status"
|
||||
}
|
||||
|
||||
run_js_streaming_prod_inference_tests()
|
||||
@ -529,4 +535,11 @@ run_js_streaming_prod_inference_tests()
|
||||
status=$?
|
||||
set -e
|
||||
assert_correct_ldc93s1_prodmodel "${phrase_pbmodel_withlm}" "$status" "${_bitrate}"
|
||||
|
||||
local _bitrate=$1
|
||||
set +e
|
||||
phrase_pbmodel_withlm=$(deepspeech --model ${TASKCLUSTER_TMP_DIR}/${model_name_mmap} --scorer ${TASKCLUSTER_TMP_DIR}/kenlm.scorer --audio ${TASKCLUSTER_TMP_DIR}/${ldc93s1_sample_filename} --stream --extended 2>${TASKCLUSTER_TMP_DIR}/stderr | tail -n 1)
|
||||
status=$?
|
||||
set -e
|
||||
assert_correct_ldc93s1_prodmodel "${phrase_pbmodel_withlm}" "$status" "${_bitrate}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user