|
22 | 22 | import com.google.cloud.speech.v1.RecognitionAudio;
|
23 | 23 | import com.google.cloud.speech.v1.RecognitionConfig;
|
24 | 24 | import com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding;
|
| 25 | +import com.google.cloud.speech.v1.RecognizeResponse; |
25 | 26 | import com.google.cloud.speech.v1.SpeechRecognitionAlternative;
|
26 | 27 | import com.google.cloud.speech.v1.SpeechRecognitionResult;
|
27 |
| -import com.google.cloud.speech.v1.RecognizeResponse; |
28 | 28 | import com.google.protobuf.ByteString;
|
29 | 29 |
|
30 | 30 | import java.io.IOException;
|
@@ -158,7 +158,8 @@ public static void asyncRecognizeFile(String fileName) throws Exception, IOExcep
|
158 | 158 | .build();
|
159 | 159 |
|
160 | 160 | // Use non-blocking call for getting file transcription
|
161 |
| - OperationFuture<LongRunningRecognizeResponse> response = speech.longRunningRecognizeAsync(config, audio); |
| 161 | + OperationFuture<LongRunningRecognizeResponse> response = |
| 162 | + speech.longRunningRecognizeAsync(config, audio); |
162 | 163 | while (!response.isDone()) {
|
163 | 164 | System.out.println("Waiting for response...");
|
164 | 165 | Thread.sleep(200);
|
@@ -196,7 +197,8 @@ public static void asyncRecognizeGcs(String gcsUri) throws Exception, IOExceptio
|
196 | 197 | .build();
|
197 | 198 |
|
198 | 199 | // Use non-blocking call for getting file transcription
|
199 |
| - OperationFuture<LongRunningRecognizeResponse> response = speech.longRunningRecognizeAsync(config, audio); |
| 200 | + OperationFuture<LongRunningRecognizeResponse> response = |
| 201 | + speech.longRunningRecognizeAsync(config, audio); |
200 | 202 | while (!response.isDone()) {
|
201 | 203 | System.out.println("Waiting for response...");
|
202 | 204 | Thread.sleep(200);
|
|
0 commit comments