diff --git a/speech/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java b/speech/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java index 1ab6059a594..fd4d460ddff 100644 --- a/speech/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java +++ b/speech/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java @@ -176,7 +176,7 @@ public void onError(Throwable t) { RecognitionConfig recognitionConfig = RecognitionConfig.newBuilder() .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16) - .setLanguageCode("en-US") + .setLanguageCode(languageCode) .setSampleRateHertz(16000) .build();