Skip to content

Commit e4db060

Browse files
samples: updated comments on recognize.js to reflect time limitations… (#650)
1 parent 7362843 commit e4db060

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

speech/recognize.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ async function asyncRecognize(
197197
sampleRateHertz: sampleRateHertz,
198198
languageCode: languageCode,
199199
};
200+
201+
/**
202+
* Note that transcription is limited to 60 seconds audio.
203+
* Use a GCS file for audio longer than 1 minute.
204+
*/
200205
const audio = {
201206
content: fs.readFileSync(filename).toString('base64'),
202207
};
@@ -528,7 +533,7 @@ async function syncRecognizeModelSelectionGCS(
528533
audio: audio,
529534
};
530535

531-
// Detects speech in the audio file
536+
// Detects speech in the audio file.
532537
const [response] = await client.recognize(request);
533538
const transcription = response.results
534539
.map(result => result.alternatives[0].transcript)
@@ -549,6 +554,7 @@ async function syncRecognizeWithAutoPunctuation(
549554
* TODO(developer): Update client library import to use new
550555
* version of API when desired features become available
551556
*/
557+
552558
const speech = require('@google-cloud/speech');
553559
const fs = require('fs');
554560

@@ -568,6 +574,7 @@ async function syncRecognizeWithAutoPunctuation(
568574
languageCode: languageCode,
569575
enableAutomaticPunctuation: true,
570576
};
577+
571578
const audio = {
572579
content: fs.readFileSync(filename).toString('base64'),
573580
};

0 commit comments

Comments
 (0)