@@ -20,6 +20,7 @@ def parse_args() -> argparse.Namespace:
20
20
parser .add_argument ("--list-input-devices" , action = "store_true" , help = "List input audio device indices." )
21
21
parser .add_argument ("--list-output-devices" , action = "store_true" , help = "List input audio device indices." )
22
22
parser .add_argument ("--output-device" , type = int , help = "Output device to use." )
23
+ parser .add_argument ("--target-language-code" , default = "en-US" , help = "Language code of the output language." )
23
24
parser .add_argument (
24
25
"--play-audio" ,
25
26
action = "store_true" ,
@@ -79,7 +80,7 @@ def main() -> None:
79
80
auth = riva .client .Auth (args .ssl_cert , args .use_ssl , args .server )
80
81
nmt_service = riva .client .NeuralMachineTranslationClient (auth )
81
82
s2s_config = riva .client .StreamingTranslateSpeechToSpeechConfig (
82
- asrConfig = riva .client .StreamingRecognitionConfig (
83
+ asr_config = riva .client .StreamingRecognitionConfig (
83
84
config = riva .client .RecognitionConfig (
84
85
encoding = riva .client .AudioEncoding .LINEAR_PCM ,
85
86
language_code = args .language_code ,
@@ -91,6 +92,9 @@ def main() -> None:
91
92
audio_channel_count = 1 ,
92
93
),
93
94
interim_results = True ,
95
+ ),
96
+ translation_config = riva .client .TranslationConfig (
97
+ target_language_code = args .target_language_code ,
94
98
)
95
99
)
96
100
0 commit comments