File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed
src/main/java/com/google/cloud/speech/grpc/demos Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 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 " $@ "
Original file line number Diff line number Diff line change 2727import 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 */
3333public class RecognitionAudioFactory {
3434
Original file line number Diff line number Diff line change 2929import com .google .cloud .speech .v1beta1 .RecognitionAudio ;
3030import com .google .cloud .speech .v1beta1 .RecognitionConfig ;
3131import com .google .cloud .speech .v1beta1 .RecognitionConfig .AudioEncoding ;
32+ import com .google .cloud .speech .v1beta1 .SpeechGrpc ;
3233import com .google .cloud .speech .v1beta1 .SyncRecognizeRequest ;
3334import com .google .cloud .speech .v1beta1 .SyncRecognizeResponse ;
34- import com .google .cloud .speech .v1beta1 .SpeechGrpc ;
3535import com .google .protobuf .TextFormat ;
3636
3737import 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 )
You can’t perform that action at this time.
0 commit comments