I’m trying Riva.
I got Riva 2.12.0 working with Jetson Agx Orin.
I was able to use transcribe_mic.py to ASR the voice input from the microphone and see the text appear in the terminal.
But this is just a demo.
I want to process the text after ASR.
I think that the text is displayed by the following process, but how can I, for example, create a new variable and copy the text into that variable?
It is also possible to print streaming results in several places, e.g. in STDOUT and also on a file. you can store it in a file and load it into a variable
my_results.txt was created when I ran transcribe_mic.py.
I spoke into the microphone.
The terminal displays ## followed by the conversation as text.
I think this is displaying text by sys.stdout.
At this time, the content of my_results.txt is blank.
When I stopped the execution of transcribe_mic.py with Ctrl +C, the text was written to my_results.txt.
I want to pass the ASR result text to other applications based on transcribe_mic.py. I think I can pass it in my_results.txt like this time, but I would like to know when the ASR result text is written in my_results.txt.
Will it not be written unless transcribe_mic.py is stopped?
I was able to obtain Riva’s output results using the following method.
thank you very much.
riva.client.add_word_boosting_to_config(config, args.boosted_lm_words, args.boosted_lm_score)
with riva.client.audio_io.MicrophoneStream(
args.sample_rate_hz,
args.file_streaming_chunk,
device=args.input_device,
) as audio_chunk_iterator:
responses = asr_service.streaming_response_generator(
audio_chunks=audio_chunk_iterator,
streaming_config=config,
)
for response in responses:
if response.results:
transcript_text = response.results[0].alternatives[0].transcript
print(transcript_text)
else:
print("Transcript data not available")