@@ -52,7 +52,7 @@ public static void main(String... args) throws Exception {
52
52
System .out .printf (
53
53
"\t java %s \" <command>\" \" <path-to-image>\" \n "
54
54
+ "Commands:\n "
55
- + "\t syncrecognize | asyncrecognize | streamrecognize | wordoffsets\n "
55
+ + "\t syncrecognize | asyncrecognize | streamrecognize | wordoffsets | model-selection \n "
56
56
+ "Path:\n \t A file path (ex: ./resources/audio.raw) or a URI "
57
57
+ "for a Cloud Storage resource (gs://...)\n " ,
58
58
Recognize .class .getCanonicalName ());
@@ -82,11 +82,11 @@ public static void main(String... args) throws Exception {
82
82
}
83
83
} else if (command .equals ("streamrecognize" )) {
84
84
streamingRecognizeFile (path );
85
- } else if (command .equals ("video " )) {
85
+ } else if (command .equals ("model-selection " )) {
86
86
if (path .startsWith ("gs://" )) {
87
- transcribeGcsVideoFile (path );
87
+ transcribeModelSelectionGcs (path );
88
88
} else {
89
- transcribeVideoFile (path );
89
+ transcribeModelSelection (path );
90
90
}
91
91
}
92
92
}
@@ -420,10 +420,10 @@ public SettableFuture<List<T>> future() {
420
420
// [START speech_transcribe_model_selection]
421
421
/**
422
422
* Performs transcription of the given audio file synchronously with
423
- * video as the original media type .
424
- * @param fileName the path to a video file to transcribe
423
+ * the selected model .
424
+ * @param fileName the path to a audio file to transcribe
425
425
*/
426
- public static void transcribeVideoFile (String fileName ) throws Exception {
426
+ public static void transcribeModelSelection (String fileName ) throws Exception {
427
427
Path path = Paths .get (fileName );
428
428
byte [] content = Files .readAllBytes (path );
429
429
@@ -456,11 +456,11 @@ public static void transcribeVideoFile(String fileName) throws Exception {
456
456
457
457
// [START speech_transcribe_model_selection_gcs]
458
458
/**
459
- * Performs transcription on remote video file and prints the transcription.
460
- *
461
- * @param gcsUri the path to the remote video file to transcribe.
459
+ * Performs transcription of the remote audio file asynchronously with
460
+ * the selected model.
461
+ * @param gcsUri the path to the remote audio file to transcribe.
462
462
*/
463
- public static void transcribeGcsVideoFile (String gcsUri ) throws Exception {
463
+ public static void transcribeModelSelectionGcs (String gcsUri ) throws Exception {
464
464
try (SpeechClient speech = SpeechClient .create ()) {
465
465
466
466
// Configure request with video media type
0 commit comments