Skip to content

Commit 5f2f0f0

Browse files
gguusschingor13
authored andcommitted
samples: Speech async examples (#612)
* Adds async examples * Adds link to Cloud Client. * Changes sleep duration * Adds GCS example.
1 parent 667fb0f commit 5f2f0f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

speech/snippets/src/main/java/com/example/speech/Recognize.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static void asyncRecognizeFile(String fileName) throws Exception, IOExcep
172172
speech.longRunningRecognizeAsync(config, audio);
173173
while (!response.isDone()) {
174174
System.out.println("Waiting for response...");
175-
Thread.sleep(200);
175+
Thread.sleep(10000);
176176
}
177177

178178
List<SpeechRecognitionResult> results = response.get().getResultsList();
@@ -211,7 +211,7 @@ public static void asyncRecognizeGcs(String gcsUri) throws Exception, IOExceptio
211211
speech.longRunningRecognizeAsync(config, audio);
212212
while (!response.isDone()) {
213213
System.out.println("Waiting for response...");
214-
Thread.sleep(200);
214+
Thread.sleep(10000);
215215
}
216216

217217
List<SpeechRecognitionResult> results = response.get().getResultsList();

0 commit comments

Comments
 (0)