From 5048a20a1429287d2e599920d0cf153e90ee99f9 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Mon, 20 Aug 2018 19:47:04 -0400 Subject: [PATCH] Speech region tag update (#145) --- samples/betaFeatures.js | 32 ++++++++++++++++---------------- samples/recognize.js | 28 ++++++++++++++-------------- samples/recognize.v1p1beta1.js | 20 ++++++++++---------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/samples/betaFeatures.js b/samples/betaFeatures.js index 834b8fa2..8f4ee55e 100644 --- a/samples/betaFeatures.js +++ b/samples/betaFeatures.js @@ -24,7 +24,7 @@ 'use strict'; function speechTranscribeDiarization(fileName) { - // [START speech_transcribe_diarization] + // [START speech_transcribe_diarization_beta] const fs = require('fs'); // Imports the Google Cloud client library @@ -78,11 +78,11 @@ function speechTranscribeDiarization(fileName) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_diarization] + // [END speech_transcribe_diarization_beta] } function asyncSpeechTranscribeDiarizationGCS(gcsUri) { - // [START speech_transcribe_diarization_gcs] + // [START speech_transcribe_diarization_gcs_beta] // Imports the Google Cloud client library const speech = require('@google-cloud/speech').v1p1beta1; @@ -134,11 +134,11 @@ function asyncSpeechTranscribeDiarizationGCS(gcsUri) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_diarization_gcs] + // [END speech_transcribe_diarization_gcs_beta] } function speechTranscribeMultiChannel(fileName) { - // [START speech_transcribe_multichannel] + // [START speech_transcribe_multichannel_beta] const fs = require('fs'); // Imports the Google Cloud client library @@ -186,11 +186,11 @@ function speechTranscribeMultiChannel(fileName) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_multichannel] + // [END speech_transcribe_multichannel_beta] } function speechTranscribeMultichannelGCS(gcsUri) { - // [START speech_transcribe_multichannel_gcs] + // [START speech_transcribe_multichannel_gcs_beta] const speech = require('@google-cloud/speech').v1p1beta1; // Creates a client @@ -230,11 +230,11 @@ function speechTranscribeMultichannelGCS(gcsUri) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_multichannel_gcs] + // [END speech_transcribe_multichannel_gcs_beta] } function speechTranscribeMultilang(fileName) { - // [START speech_transcribe_multilanguage] + // [START speech_transcribe_multilanguage_beta] const fs = require('fs'); // Imports the Google Cloud client library @@ -276,11 +276,11 @@ function speechTranscribeMultilang(fileName) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_multilang] + // [END speech_transcribe_multilanguage_beta] } function speechTranscribeMultilangGCS(gcsUri) { - // [START speech_transcribe_multilang_gcs] + // [START speech_transcribe_multilanguage_gcs_beta] // Imports the Google Cloud client library const speech = require('@google-cloud/speech').v1p1beta1; @@ -324,11 +324,11 @@ function speechTranscribeMultilangGCS(gcsUri) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_multilang_gcs] + // [END speech_transcribe_multilanguage_gcs_beta] } function speechTranscribeWordLevelConfidence(fileName) { - // [START speech_transcribe_word_level_confidence] + // [START speech_transcribe_word_level_confidence_beta] const fs = require('fs'); // Imports the Google Cloud client library @@ -381,11 +381,11 @@ function speechTranscribeWordLevelConfidence(fileName) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_word_level_confidence] + // [END speech_transcribe_word_level_confidence_beta] } function speechTranscribeWordLevelConfidenceGCS(gcsUri) { - // [START speech_transcribe_word_level_confidence_gcs] + // [START speech_transcribe_word_level_confidence_gcs_beta] // Imports the Google Cloud client library const speech = require('@google-cloud/speech').v1p1beta1; @@ -436,7 +436,7 @@ function speechTranscribeWordLevelConfidenceGCS(gcsUri) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_word_level_confidence_gcs] + // [END speech_transcribe_word_level_confidence_gcs_beta] } require(`yargs`) diff --git a/samples/recognize.js b/samples/recognize.js index ddaef6e8..5c3cbdf6 100644 --- a/samples/recognize.js +++ b/samples/recognize.js @@ -24,7 +24,7 @@ 'use strict'; function syncRecognize(filename, encoding, sampleRateHertz, languageCode) { - // [START speech_sync_recognize] + // [START speech_transcribe_sync] // Imports the Google Cloud client library const fs = require('fs'); const speech = require('@google-cloud/speech'); @@ -67,11 +67,11 @@ function syncRecognize(filename, encoding, sampleRateHertz, languageCode) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_sync_recognize] + // [END speech_transcribe_sync] } function syncRecognizeGCS(gcsUri, encoding, sampleRateHertz, languageCode) { - // [START speech_sync_recognize_gcs] + // [START speech_transcribe_sync_gcs] // Imports the Google Cloud client library const speech = require('@google-cloud/speech'); @@ -113,7 +113,7 @@ function syncRecognizeGCS(gcsUri, encoding, sampleRateHertz, languageCode) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_sync_recognize_gcs] + // [END speech_transcribe_sync_gcs] } function syncRecognizeWords(filename, encoding, sampleRateHertz, languageCode) { @@ -178,7 +178,7 @@ function syncRecognizeWords(filename, encoding, sampleRateHertz, languageCode) { } function asyncRecognize(filename, encoding, sampleRateHertz, languageCode) { - // [START speech_async_recognize] + // [START speech_transcribe_async] // Imports the Google Cloud client library const speech = require('@google-cloud/speech'); const fs = require('fs'); @@ -228,11 +228,11 @@ function asyncRecognize(filename, encoding, sampleRateHertz, languageCode) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_async_recognize] + // [END speech_transcribe_async] } function asyncRecognizeGCS(gcsUri, encoding, sampleRateHertz, languageCode) { - // [START speech_async_recognize_gcs] + // [START speech_transcribe_async_gcs] // Imports the Google Cloud client library const speech = require('@google-cloud/speech'); @@ -281,7 +281,7 @@ function asyncRecognizeGCS(gcsUri, encoding, sampleRateHertz, languageCode) { .catch(err => { console.error('ERROR:', err); }); - // [END speech_async_recognize_gcs] + // [END speech_transcribe_async_gcs] } function asyncRecognizeGCSWords( @@ -290,7 +290,7 @@ function asyncRecognizeGCSWords( sampleRateHertz, languageCode ) { - // [START speech_async_recognize_gcs_words] + // [START speech_transcribe_async_time_offsets_gcs] // Imports the Google Cloud client library const speech = require('@google-cloud/speech'); @@ -353,11 +353,11 @@ function asyncRecognizeGCSWords( .catch(err => { console.error('ERROR:', err); }); - // [END speech_async_recognize_gcs_words] + // [END speech_transcribe_async_time_offsets_gcs] } function streamingRecognize(filename, encoding, sampleRateHertz, languageCode) { - // [START speech_streaming_recognize] + // [START speech_transcribe_streaming] const fs = require('fs'); // Imports the Google Cloud client library @@ -395,11 +395,11 @@ function streamingRecognize(filename, encoding, sampleRateHertz, languageCode) { // Stream an audio file from disk to the Speech API, e.g. "./resources/audio.raw" fs.createReadStream(filename).pipe(recognizeStream); - // [END speech_streaming_recognize] + // [END speech_transcribe_streaming] } function streamingMicRecognize(encoding, sampleRateHertz, languageCode) { - // [START speech_streaming_mic_recognize] + // [START speech_transcribe_streaming_mic] const record = require('node-record-lpcm16'); // Imports the Google Cloud client library @@ -450,7 +450,7 @@ function streamingMicRecognize(encoding, sampleRateHertz, languageCode) { .pipe(recognizeStream); console.log('Listening, press Ctrl+C to stop.'); - // [END speech_streaming_mic_recognize] + // [END speech_transcribe_streaming_mic] } require(`yargs`) diff --git a/samples/recognize.v1p1beta1.js b/samples/recognize.v1p1beta1.js index 76232e50..6d568a3b 100644 --- a/samples/recognize.v1p1beta1.js +++ b/samples/recognize.v1p1beta1.js @@ -30,7 +30,7 @@ function syncRecognizeModelSelection( sampleRateHertz, languageCode ) { - // [START speech_transcribe_model_selection] + // [START speech_transcribe_model_selection_beta] // Imports the Google Cloud client library for Beta API /** * TODO(developer): Update client library import to use new @@ -79,7 +79,7 @@ function syncRecognizeModelSelection( .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_model_selection] + // [END speech_transcribe_model_selection_beta] } function syncRecognizeModelSelectionGCS( @@ -89,7 +89,7 @@ function syncRecognizeModelSelectionGCS( sampleRateHertz, languageCode ) { - // [START speech_transcribe_model_selection_gcs] + // [START speech_transcribe_model_selection_gcs_beta] // Imports the Google Cloud client library for Beta API /** * TODO(developer): Update client library import to use new @@ -137,7 +137,7 @@ function syncRecognizeModelSelectionGCS( .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_model_selection_gcs] + // [END speech_transcribe_model_selection_gcs_beta] } function syncRecognizeWithAutoPunctuation( @@ -146,7 +146,7 @@ function syncRecognizeWithAutoPunctuation( sampleRateHertz, languageCode ) { - // [START speech_transcribe_file_with_auto_punctuation] + // [START speech_transcribe_auto_punctuation_beta] // Imports the Google Cloud client library for Beta API /** * TODO(developer): Update client library import to use new @@ -193,7 +193,7 @@ function syncRecognizeWithAutoPunctuation( .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_file_with_auto_punctuation] + // [END speech_transcribe_auto_punctuation_beta] } function syncRecognizeWithMetaData( @@ -202,7 +202,7 @@ function syncRecognizeWithMetaData( sampleRateHertz, languageCode ) { - // [START speech_transcribe_file_with_metadata] + // [START speech_transcribe_recognition_metadata_beta] // Imports the Google Cloud client library for Beta API /** * TODO(developer): Update client library import to use new @@ -258,7 +258,7 @@ function syncRecognizeWithMetaData( .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_file_with_metadata] + // [END speech_transcribe_recognition_metadata_beta] } function syncRecognizeWithEnhancedModel( @@ -267,7 +267,7 @@ function syncRecognizeWithEnhancedModel( sampleRateHertz, languageCode ) { - // [START speech_transcribe_file_with_enhanced_model] + // [START speech_transcribe_enhanced_model_beta] // Imports the Google Cloud client library for Beta API /** * TODO(developer): Update client library import to use new @@ -315,7 +315,7 @@ function syncRecognizeWithEnhancedModel( .catch(err => { console.error('ERROR:', err); }); - // [END speech_transcribe_file_with_enhanced_model] + // [END speech_transcribe_enhanced_model_beta] } require(`yargs`)