File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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);
2828fs . 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
3234recognizeStream.pipe(fs.createWriteStream('transcription.txt'));
3335
3436// get strings instead of Buffers from `data` events
35- // only do this when objectMode is `false`
3637recognizeStream.setEncoding('utf8');
3738*/
3839
You can’t perform that action at this time.
0 commit comments