From 9772d8c8e1b588e4f60736cc0b7de58b0ebe1a94 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Tue, 11 Apr 2017 12:29:22 -0500 Subject: [PATCH] Update samples to match new Speech API (#342) Update samples to match new Speech API --- packages/google-cloud-speech/samples/package.json | 2 +- packages/google-cloud-speech/samples/quickstart.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-speech/samples/package.json b/packages/google-cloud-speech/samples/package.json index d1c6f0ba656..e0902234332 100644 --- a/packages/google-cloud-speech/samples/package.json +++ b/packages/google-cloud-speech/samples/package.json @@ -8,7 +8,7 @@ "test": "cd ..; npm run st -- --verbose speech/system-test/*.test.js" }, "dependencies": { - "@google-cloud/speech": "0.6.0", + "@google-cloud/speech": "0.9.0", "@google-cloud/storage": "0.7.0", "node-record-lpcm16": "0.2.0", "yargs": "6.6.0" diff --git a/packages/google-cloud-speech/samples/quickstart.js b/packages/google-cloud-speech/samples/quickstart.js index bc2cde2bd46..48c58b2c1d6 100644 --- a/packages/google-cloud-speech/samples/quickstart.js +++ b/packages/google-cloud-speech/samples/quickstart.js @@ -30,10 +30,11 @@ const speechClient = Speech({ // The name of the audio file to transcribe const fileName = './resources/audio.raw'; -// The audio file's encoding and sample rate +// The audio file's encoding, sample rate in hertz, and BCP-47 language code const options = { encoding: 'LINEAR16', - sampleRate: 16000 + sampleRateHertz: 16000, + languageCode: 'en-US' }; // Detects speech in the audio file