Skip to content

Commit

Permalink
Use template literals
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerjou Cheng committed Aug 30, 2017
1 parent d8f6822 commit 82c1907
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions speech/recognize.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function syncRecognize (filename, encoding, sampleRateHertz, languageCode) {
const response = data[0];
const transcription = response.results.map(result =>
result.alternatives[0].transcript).join('\n');
console.log(`Transcription: `, transcription);
console.log(`Transcription: ${transcription}`);
})
.catch((err) => {
console.error('ERROR:', err);
Expand Down Expand Up @@ -112,7 +112,7 @@ function syncRecognizeGCS (gcsUri, encoding, sampleRateHertz, languageCode) {
const response = data[0];
const transcription = response.results.map(result =>
result.alternatives[0].transcript).join('\n');
console.log(`Transcription: `, transcription);
console.log(`Transcription: ${transcription}`);
})
.catch((err) => {
console.error('ERROR:', err);
Expand Down Expand Up @@ -161,7 +161,7 @@ function syncRecognizeWords (filename, encoding, sampleRateHertz, languageCode)
.then((data) => {
const response = data[0];
response.results.forEach((result) => {
console.log(`Transcription: `, result.alternatives[0].transcript);
console.log(`Transcription: ${result.alternatives[0].transcript}`);
result.alternatives[0].words.forEach((wordInfo) => {
// NOTE: If you have a time offset exceeding 2^32 seconds, use the
// wordInfo.{x}Time.seconds.high to calculate seconds.
Expand Down Expand Up @@ -338,7 +338,7 @@ function asyncRecognizeGCSWords (gcsUri, encoding, sampleRateHertz, languageCode
.then((data) => {
const response = data[0];
response.results.forEach((result) => {
console.log(`Transcription: `, result.alternatives[0].transcript);
console.log(`Transcription: ${result.alternatives[0].transcript}`);
result.alternatives[0].words.forEach((wordInfo) => {
// NOTE: If you have a time offset exceeding 2^32 seconds, use the
// wordInfo.{x}Time.seconds.high to calculate seconds.
Expand Down

0 comments on commit 82c1907

Please sign in to comment.