GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Getting metadata/progress of a long-running recognition · Issue #819 · GoogleCloudPlatform/java-docs-samples Closed DescriptionIn which file did you encounter the issue?java-docs-samples/speech/cloud-client/src/main/java/com/example/speech/Recognize.java Did you change the file? If so, how?I modified the while loop to attempt getting the progress of the operation in OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata, Operation> response = speech.longRunningRecognizeAsync(config, audio); while (!response.isDone()) { ApiFuture<LongRunningRecognizeMetadata> future = response.peekMetadata(); if (future != null) { LongRunningRecognizeMetadata meta = future.get(); if (meta != null) { int percent = meta.getProgressPercent(); System.out.println(String.format("Percent complete: %s%%", percent)); } } Thread.sleep(500); } The while loop used to be: while (!response.isDone()) { System.out.println("Waiting for response..."); Thread.sleep(10000); } Describe the issueAPI version in Gradle: 'com.google.cloud:google-cloud-speech:0.21.1-alpha' Using some test audio about 14 seconds long, getting the metadata of the response doesn't return anything until the response is complete. Using From the documentation on the metadata in REST it does show that progress can be returned, but Java uses gRPC. Perhaps I'm using the code incorrectly, but otherwise would hope for some documentation or the feature to be available in the Java client library. Having progress output for very long audio (now up to 3 hours after the recent update) is almost necessary. Activity
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |