diff --git a/native_client/javascript/client.ts b/native_client/javascript/client.ts index ecf00a95..d607060e 100644 --- a/native_client/javascript/client.ts +++ b/native_client/javascript/client.ts @@ -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()); + } }); } diff --git a/taskcluster/tc-asserts.sh b/taskcluster/tc-asserts.sh index 62f1e8ff..a56a4c49 100755 --- a/taskcluster/tc-asserts.sh +++ b/taskcluster/tc-asserts.sh @@ -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}" }