1
1
/*
2
- * Copyright 2021 Google LLC
2
+ * Copyright 2022 Google LLC
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
38
38
* calls that map to API methods. Sample code to get started:
39
39
*
40
40
41
+ * // This snippet has been automatically generated for illustrative purposes only.
42
+ * // It may require modifications to work in your environment.
41
43
* try (SpeechClient speechClient = SpeechClient.create()) {
42
44
* RecognitionConfig config = RecognitionConfig.newBuilder().build();
43
45
* RecognitionAudio audio = RecognitionAudio.newBuilder().build();
74
76
* To customize credentials:
75
77
*
76
78
79
+ * // This snippet has been automatically generated for illustrative purposes only.
80
+ * // It may require modifications to work in your environment.
77
81
* SpeechSettings speechSettings =
78
82
* SpeechSettings.newBuilder()
79
83
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
84
88
* To customize the endpoint:
85
89
*
86
90
91
+ * // This snippet has been automatically generated for illustrative purposes only.
92
+ * // It may require modifications to work in your environment.
87
93
* SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
88
94
* SpeechClient speechClient = SpeechClient.create(speechSettings);
89
95
* }
@@ -160,6 +166,8 @@ public final OperationsClient getOperationsClient() {
160
166
161
167
*
162
168
169
+ * // This snippet has been automatically generated for illustrative purposes only.
170
+ * // It may require modifications to work in your environment.
163
171
* try (SpeechClient speechClient = SpeechClient.create()) {
164
172
* RecognitionConfig config = RecognitionConfig.newBuilder().build();
165
173
* RecognitionAudio audio = RecognitionAudio.newBuilder().build();
@@ -186,6 +194,8 @@ public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAu
186
194
187
195
*
188
196
197
+ * // This snippet has been automatically generated for illustrative purposes only.
198
+ * // It may require modifications to work in your environment.
189
199
* try (SpeechClient speechClient = SpeechClient.create()) {
190
200
* RecognizeRequest request =
191
201
* RecognizeRequest.newBuilder()
@@ -211,6 +221,8 @@ public final RecognizeResponse recognize(RecognizeRequest request) {
211
221
212
222
*
213
223
224
+ * // This snippet has been automatically generated for illustrative purposes only.
225
+ * // It may require modifications to work in your environment.
214
226
* try (SpeechClient speechClient = SpeechClient.create()) {
215
227
* RecognizeRequest request =
216
228
* RecognizeRequest.newBuilder()
@@ -237,6 +249,8 @@ public final UnaryCallable recognizeCallabl
237
249
238
250
*
239
251
252
+ * // This snippet has been automatically generated for illustrative purposes only.
253
+ * // It may require modifications to work in your environment.
240
254
* try (SpeechClient speechClient = SpeechClient.create()) {
241
255
* RecognitionConfig config = RecognitionConfig.newBuilder().build();
242
256
* RecognitionAudio audio = RecognitionAudio.newBuilder().build();
@@ -267,6 +281,8 @@ public final UnaryCallable recognizeCallabl
267
281
268
282
*
269
283
284
+ * // This snippet has been automatically generated for illustrative purposes only.
285
+ * // It may require modifications to work in your environment.
270
286
* try (SpeechClient speechClient = SpeechClient.create()) {
271
287
* LongRunningRecognizeRequest request =
272
288
* LongRunningRecognizeRequest.newBuilder()
@@ -296,6 +312,8 @@ public final UnaryCallable recognizeCallabl
296
312
297
313
*
298
314
315
+ * // This snippet has been automatically generated for illustrative purposes only.
316
+ * // It may require modifications to work in your environment.
299
317
* try (SpeechClient speechClient = SpeechClient.create()) {
300
318
* LongRunningRecognizeRequest request =
301
319
* LongRunningRecognizeRequest.newBuilder()
@@ -326,6 +344,8 @@ public final UnaryCallable recognizeCallabl
326
344
327
345
*
328
346
347
+ * // This snippet has been automatically generated for illustrative purposes only.
348
+ * // It may require modifications to work in your environment.
329
349
* try (SpeechClient speechClient = SpeechClient.create()) {
330
350
* LongRunningRecognizeRequest request =
331
351
* LongRunningRecognizeRequest.newBuilder()
@@ -352,6 +372,8 @@ public final UnaryCallable recognizeCallabl
352
372
353
373
*
354
374
375
+ * // This snippet has been automatically generated for illustrative purposes only.
376
+ * // It may require modifications to work in your environment.
355
377
* try (SpeechClient speechClient = SpeechClient.create()) {
356
378
* BidiStream bidiStream =
357
379
* speechClient.streamingRecognizeCallable().call();
0 commit comments