Skip to content

Commit e1516d2

Browse files
committed
made changes to script and tests
Author: puneith <puneith@google.com>
1 parent 3892470 commit e1516d2

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

speech/grpc/bin/speech-sample-sync.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# Copyright 2016 Google Inc. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
SRC_DIR=$(cd "$(dirname "$0")/.."; pwd)
17+
java -cp ${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar \
18+
com.google.cloud.speech.grpc.demos.SyncRecognizeClient "$@"

speech/grpc/src/main/java/com/google/cloud/speech/grpc/demos/RecognitionAudioFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import java.nio.file.Paths;
2828

2929
/*
30-
* RecognitionAudioFactory takes a URI as an input and creates a RecognitionAudio. The URI can point to a
31-
* local file or a file on Google Cloud Storage.
30+
* RecognitionAudioFactory takes a URI as an input and creates a RecognitionAudio.
31+
* The URI can point to a local file or a file on Google Cloud Storage.
3232
*/
3333
public class RecognitionAudioFactory {
3434

speech/grpc/src/main/java/com/google/cloud/speech/grpc/demos/SyncRecognizeClient.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
import com.google.cloud.speech.v1beta1.RecognitionAudio;
3030
import com.google.cloud.speech.v1beta1.RecognitionConfig;
3131
import com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding;
32+
import com.google.cloud.speech.v1beta1.SpeechGrpc;
3233
import com.google.cloud.speech.v1beta1.SyncRecognizeRequest;
3334
import com.google.cloud.speech.v1beta1.SyncRecognizeResponse;
34-
import com.google.cloud.speech.v1beta1.SpeechGrpc;
3535
import com.google.protobuf.TextFormat;
3636

3737
import io.grpc.ManagedChannel;
@@ -114,9 +114,9 @@ public void recognize() {
114114
}
115115
logger.info("Sending " + audio.getContent().size() + " bytes from audio uri input: " + input);
116116
RecognitionConfig config = RecognitionConfig.newBuilder()
117-
.setEncoding(AudioEncoding.LINEAR16)
118-
.setSampleRate(samplingRate)
119-
.build();
117+
.setEncoding(AudioEncoding.LINEAR16)
118+
.setSampleRate(samplingRate)
119+
.build();
120120
SyncRecognizeRequest request = SyncRecognizeRequest.newBuilder()
121121
.setConfig(config)
122122
.setAudio(audio)

0 commit comments

Comments
 (0)