Skip to content

Commit ea870bf

Browse files
dpopp07germanattanasio
authored andcommitted
address pr comments on stt example
1 parent f32ad63 commit ea870bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/speech_to_text.v1.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var speechToText = new SpeechToTextV1({
1212
This code will print the entire response to the console when it
1313
receives the 'data' event. Some applications will want to write
1414
out only the transcribed text, to the console or to a file.
15-
To this, remove `objectMode: true` from the `params` object.
15+
To do this, remove `objectMode: true` from the `params` object.
1616
Then, uncomment the block of code at Line 30.
1717
*/
1818

@@ -28,11 +28,12 @@ var recognizeStream = speechToText.createRecognizeStream(params);
2828
fs.createReadStream(__dirname + '/resources/speech.wav').pipe(recognizeStream);
2929

3030
/*
31+
// these two lines of code will only work if `objectMode` is `false`
32+
3133
// pipe out the transcription to a file
3234
recognizeStream.pipe(fs.createWriteStream('transcription.txt'));
3335
3436
// get strings instead of Buffers from `data` events
35-
// only do this when objectMode is `false`
3637
recognizeStream.setEncoding('utf8');
3738
*/
3839

0 commit comments

Comments
 (0)