Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions speech/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ with Java.
- [grpc](grpc)

A sample for accessing Cloud Speech streaming and non streaming apis with [gRPC](http://www.grpc.io/).

- [Cloud Client](cloud-client)

A sample for accessing Cloud Speech streaming and non streaming apis using the [Cloud Client Library for Java](https://github.com/GoogleCloudPlatform/google-cloud-java).
12 changes: 12 additions & 0 deletions speech/cloud-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,20 @@ You can then run a given `ClassName` via:
-Dexec.args="syncrecognize ./resources/audio.raw"
```

### Asynchronously transcribe a local audio file (using the recognize sample)
```
mvn exec:java -Dexec.mainClass=com.example.speech.Recognize \
-Dexec.args="asyncrecognize ./resources/audio.raw"
```

### Transcribe a remote audio file (using the recognize sample)
```
mvn exec:java -Dexec.mainClass=com.example.speech.Recognize \
-Dexec.args="syncrecognize 'gs://cloud-samples-tests/speech/brooklyn.flac'"
```

### Asynchronously transcribe a remote audio file (using the recognize sample)
```
mvn exec:java -Dexec.mainClass=com.example.speech.Recognize \
-Dexec.args="asyncrecognize 'gs://cloud-samples-tests/speech/brooklyn.flac'"
```
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static void asyncRecognizeFile(String fileName) throws Exception, IOExcep
speech.longRunningRecognizeAsync(config, audio);
while (!response.isDone()) {
System.out.println("Waiting for response...");
Thread.sleep(200);
Thread.sleep(10000);
}

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

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