Skip to content

Commit

Permalink
Speech region tag update (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
alixhami authored and Ace Nassri committed Nov 17, 2022
1 parent 660b70d commit c22d23f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
32 changes: 16 additions & 16 deletions speech/betaFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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`)
Expand Down
28 changes: 14 additions & 14 deletions speech/recognize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');

Expand Down Expand Up @@ -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(
Expand All @@ -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');

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`)
Expand Down
20 changes: 10 additions & 10 deletions speech/recognize.v1p1beta1.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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`)
Expand Down

0 comments on commit c22d23f

Please sign in to comment.