Skip to content

Commit

Permalink
Upgrades client and addresses changes to long running operations
Browse files Browse the repository at this point in the history
  • Loading branch information
gguuss committed Jul 12, 2017
1 parent ead4ce1 commit cc37a89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion speech/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud</artifactId>
<version>0.20.0-alpha</version>
<version>0.20.1-alpha</version>
</dependency>
<!-- [END dependencies] -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.api.gax.grpc.OperationFuture;
import com.google.api.gax.grpc.StreamingCallable;
import com.google.cloud.speech.v1.LongRunningRecognizeResponse;
import com.google.cloud.speech.v1.LongRunningRecognizeMetadata;
import com.google.cloud.speech.v1.RecognitionAudio;
import com.google.cloud.speech.v1.RecognitionConfig;
import com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding;
Expand Down Expand Up @@ -168,7 +169,7 @@ public static void asyncRecognizeFile(String fileName) throws Exception, IOExcep
.build();

// Use non-blocking call for getting file transcription
OperationFuture<LongRunningRecognizeResponse> response =
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> response =
speech.longRunningRecognizeAsync(config, audio);
while (!response.isDone()) {
System.out.println("Waiting for response...");
Expand Down Expand Up @@ -207,7 +208,7 @@ public static void asyncRecognizeGcs(String gcsUri) throws Exception, IOExceptio
.build();

// Use non-blocking call for getting file transcription
OperationFuture<LongRunningRecognizeResponse> response =
OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> response =
speech.longRunningRecognizeAsync(config, audio);
while (!response.isDone()) {
System.out.println("Waiting for response...");
Expand Down

0 comments on commit cc37a89

Please sign in to comment.