Skip to content

Commit ad7b7a0

Browse files
yoshi-automationchingor13
authored andcommitted
chore: update common templates, regenerate tests
1 parent 8cd1669 commit ad7b7a0

18 files changed

+112
-22
lines changed

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsync.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,19 @@ public class SpeechTranscribeAsync {
5959
* import java.nio.file.Paths;
6060
*/
6161

62+
public static void sampleLongRunningRecognize() {
63+
// TODO(developer): Replace these variables before running the sample.
64+
String localFilePath = "resources/brooklyn_bridge.raw";
65+
sampleLongRunningRecognize(localFilePath);
66+
}
67+
6268
/**
6369
* Transcribe a long audio file using asynchronous speech recognition
6470
*
6571
* @param localFilePath Path to local audio file, e.g. /path/audio.wav
6672
*/
6773
public static void sampleLongRunningRecognize(String localFilePath) {
6874
try (SpeechClient speechClient = SpeechClient.create()) {
69-
// localFilePath = "resources/brooklyn_bridge.raw";
7075

7176
// The language of the supplied audio
7277
String languageCode = "en-US";

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncGcs.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,19 @@ public class SpeechTranscribeAsyncGcs {
5151
* import com.google.cloud.speech.v1.SpeechRecognitionResult;
5252
*/
5353

54+
public static void sampleLongRunningRecognize() {
55+
// TODO(developer): Replace these variables before running the sample.
56+
String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.raw";
57+
sampleLongRunningRecognize(storageUri);
58+
}
59+
5460
/**
5561
* Transcribe long audio file from Cloud Storage using asynchronous speech recognition
5662
*
5763
* @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE]
5864
*/
5965
public static void sampleLongRunningRecognize(String storageUri) {
6066
try (SpeechClient speechClient = SpeechClient.create()) {
61-
// storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.raw";
6267

6368
// Sample rate in Hertz of the audio data sent
6469
int sampleRateHertz = 16000;

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncWordTimeOffsetsGcs.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,19 @@ public class SpeechTranscribeAsyncWordTimeOffsetsGcs {
5353
* import com.google.cloud.speech.v1.WordInfo;
5454
*/
5555

56+
public static void sampleLongRunningRecognize() {
57+
// TODO(developer): Replace these variables before running the sample.
58+
String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.flac";
59+
sampleLongRunningRecognize(storageUri);
60+
}
61+
5662
/**
5763
* Print start and end time of each word spoken in audio file from Cloud Storage
5864
*
5965
* @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE]
6066
*/
6167
public static void sampleLongRunningRecognize(String storageUri) {
6268
try (SpeechClient speechClient = SpeechClient.create()) {
63-
// storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.flac";
6469

6570
// When enabled, the first result returned by the API will include a list
6671
// of words and the start and end time offsets (timestamps) for those words.

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeEnhancedModel.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,19 @@ public class SpeechTranscribeEnhancedModel {
5555
* import java.nio.file.Paths;
5656
*/
5757

58+
public static void sampleRecognize() {
59+
// TODO(developer): Replace these variables before running the sample.
60+
String localFilePath = "resources/hello.wav";
61+
sampleRecognize(localFilePath);
62+
}
63+
5864
/**
5965
* Transcribe a short audio file using an enhanced model
6066
*
6167
* @param localFilePath Path to local audio file, e.g. /path/audio.wav
6268
*/
6369
public static void sampleRecognize(String localFilePath) {
6470
try (SpeechClient speechClient = SpeechClient.create()) {
65-
// localFilePath = "resources/hello.wav";
6671

6772
// The enhanced model to use, e.g. phone_call
6873
// Currently phone_call is the only model available as an enhanced model.

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelection.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ public class SpeechTranscribeModelSelection {
5555
* import java.nio.file.Paths;
5656
*/
5757

58+
public static void sampleRecognize() {
59+
// TODO(developer): Replace these variables before running the sample.
60+
String localFilePath = "resources/hello.wav";
61+
String model = "phone_call";
62+
sampleRecognize(localFilePath, model);
63+
}
64+
5865
/**
5966
* Transcribe a short audio file using a specified transcription model
6067
*
@@ -65,8 +72,6 @@ public class SpeechTranscribeModelSelection {
6572
*/
6673
public static void sampleRecognize(String localFilePath, String model) {
6774
try (SpeechClient speechClient = SpeechClient.create()) {
68-
// localFilePath = "resources/hello.wav";
69-
// model = "phone_call";
7075

7176
// The language of the supplied audio
7277
String languageCode = "en-US";

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelectionGcs.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ public class SpeechTranscribeModelSelectionGcs {
4747
* import com.google.cloud.speech.v1.SpeechRecognitionResult;
4848
*/
4949

50+
public static void sampleRecognize() {
51+
// TODO(developer): Replace these variables before running the sample.
52+
String storageUri = "gs://cloud-samples-data/speech/hello.wav";
53+
String model = "phone_call";
54+
sampleRecognize(storageUri, model);
55+
}
56+
5057
/**
5158
* Transcribe a short audio file from Cloud Storage using a specified transcription model
5259
*
@@ -57,8 +64,6 @@ public class SpeechTranscribeModelSelectionGcs {
5764
*/
5865
public static void sampleRecognize(String storageUri, String model) {
5966
try (SpeechClient speechClient = SpeechClient.create()) {
60-
// storageUri = "gs://cloud-samples-data/speech/hello.wav";
61-
// model = "phone_call";
6267

6368
// The language of the supplied audio
6469
String languageCode = "en-US";

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannel.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,19 @@ public class SpeechTranscribeMultichannel {
5555
* import java.nio.file.Paths;
5656
*/
5757

58+
public static void sampleRecognize() {
59+
// TODO(developer): Replace these variables before running the sample.
60+
String localFilePath = "resources/multi.wav";
61+
sampleRecognize(localFilePath);
62+
}
63+
5864
/**
5965
* Transcribe a short audio file with multiple channels
6066
*
6167
* @param localFilePath Path to local audio file, e.g. /path/audio.wav
6268
*/
6369
public static void sampleRecognize(String localFilePath) {
6470
try (SpeechClient speechClient = SpeechClient.create()) {
65-
// localFilePath = "resources/multi.wav";
6671

6772
// The number of channels in the input audio file (optional)
6873
int audioChannelCount = 2;

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannelGcs.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ public class SpeechTranscribeMultichannelGcs {
4747
* import com.google.cloud.speech.v1.SpeechRecognitionResult;
4848
*/
4949

50+
public static void sampleRecognize() {
51+
// TODO(developer): Replace these variables before running the sample.
52+
String storageUri = "gs://cloud-samples-data/speech/multi.wav";
53+
sampleRecognize(storageUri);
54+
}
55+
5056
/**
5157
* Transcribe a short audio file from Cloud Storage with multiple channels
5258
*
5359
* @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE]
5460
*/
5561
public static void sampleRecognize(String storageUri) {
5662
try (SpeechClient speechClient = SpeechClient.create()) {
57-
// storageUri = "gs://cloud-samples-data/speech/multi.wav";
5863

5964
// The number of channels in the input audio file (optional)
6065
int audioChannelCount = 2;

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSync.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,19 @@ public class SpeechTranscribeSync {
5555
* import java.nio.file.Paths;
5656
*/
5757

58+
public static void sampleRecognize() {
59+
// TODO(developer): Replace these variables before running the sample.
60+
String localFilePath = "resources/brooklyn_bridge.raw";
61+
sampleRecognize(localFilePath);
62+
}
63+
5864
/**
5965
* Transcribe a short audio file using synchronous speech recognition
6066
*
6167
* @param localFilePath Path to local audio file, e.g. /path/audio.wav
6268
*/
6369
public static void sampleRecognize(String localFilePath) {
6470
try (SpeechClient speechClient = SpeechClient.create()) {
65-
// localFilePath = "resources/brooklyn_bridge.raw";
6671

6772
// The language of the supplied audio
6873
String languageCode = "en-US";

speech/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSyncGcs.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ public class SpeechTranscribeSyncGcs {
4747
* import com.google.cloud.speech.v1.SpeechRecognitionResult;
4848
*/
4949

50+
public static void sampleRecognize() {
51+
// TODO(developer): Replace these variables before running the sample.
52+
String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.raw";
53+
sampleRecognize(storageUri);
54+
}
55+
5056
/**
5157
* Transcribe short audio file from Cloud Storage using synchronous speech recognition
5258
*
5359
* @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE]
5460
*/
5561
public static void sampleRecognize(String storageUri) {
5662
try (SpeechClient speechClient = SpeechClient.create()) {
57-
// storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.raw";
5863

5964
// Sample rate in Hertz of the audio data sent
6065
int sampleRateHertz = 16000;

0 commit comments

Comments
 (0)