File tree 1 file changed +3
-8
lines changed
packages/google-cloud-node/samples
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,17 @@ function main() {
18
18
// [START speech_quickstart]
19
19
// Imports the Google Cloud client library
20
20
const speech = require ( '@google-cloud/speech' ) ;
21
- const fs = require ( 'fs' ) . promises ;
22
21
23
22
// Creates a client
24
23
const client = new speech . SpeechClient ( ) ;
25
24
26
25
async function quickstart ( ) {
27
- // The name of the audio file to transcribe
28
- const fileName = './resources/audio.raw' ;
29
-
30
- // Reads a local audio file and converts it to base64
31
- const file = await fs . readFile ( fileName ) ;
32
- const audioBytes = file . toString ( 'base64' ) ;
26
+ // The path to the remote LINEAR16 file
27
+ const gcsUri = 'gs://cloud-samples-data/speech/brooklyn_bridge.raw' ;
33
28
34
29
// The audio file's encoding, sample rate in hertz, and BCP-47 language code
35
30
const audio = {
36
- content : audioBytes ,
31
+ uri : gcsUri ,
37
32
} ;
38
33
const config = {
39
34
encoding : 'LINEAR16' ,
You can’t perform that action at this time.
0 commit comments