Transcription using gRPC API
# Copy the sample WAV file from the running NIM container to the host machine.
docker cp riva-speech:/opt/riva/wav/en-US_sample.wav .
# Streaming mode: Input speech file is streamed to the service chunk-by-chunk. Transcript is printed on the console.
python3 python-clients/scripts/asr/transcribe_file.py --server 0.0.0.0:50051 \
--language-code en-US --input-file en-US_sample.wav
# Offline mode: Input speech file is sent to the service in one shot. Transcript is printed on the console.
python3 python-clients/scripts/asr/transcribe_file_offline.py --server 0.0.0.0:50051 \
--language-code en-US --input-file en-US_sample.wav
Transcription using gRPC API
# Copy the sample WAV file from the running NIM container to the host machine.
docker cp riva-speech:/opt/riva/wav/es-US_sample.wav .
# Streaming mode: Input speech file is streamed to the service chunk-by-chunk. Transcript is printed on the console.
python3 python-clients/scripts/asr/transcribe_file.py --server 0.0.0.0:50051 \
--language-code es-US --input-file es-US_sample.wav
# Offline mode: Input speech file is sent to the service in one shot. Transcript is printed on the console.
python3 python-clients/scripts/asr/transcribe_file_offline.py --server 0.0.0.0:50051 \
--language-code es-US --input-file es-US_sample.wav
Whisper supports transcription in multiple languages. See Supported Languages for the list of all available languages and corresponding code. Specifying input language is optional but recommended as it will improve accuracy and latency.
Copy an example audio file or use your own.
# Copy the sample WAV file from the running NIM container to the host machine.
docker cp riva-speech:/opt/riva/wav/en-US_sample.wav .
Transcription using gRPC API
# Offline mode: Input speech file is sent to the service in one shot. Transcript is printed on the console.
python3 python-clients/scripts/asr/transcribe_file_offline.py --server 0.0.0.0:50051 \
--input-file en-US_sample.wav --custom-configuration source_language:en
Transcription using HTTP API
# Invoke the HTTP endpoint for transcription.
curl -s http://localhost:9000/v1/audio/transcriptions -F language=en -F file="@en-US_sample.wav"
Whisper supports translation from multiple languages to English language. See Supported Languages for the list of all available languages and corresponding code. Specifying input language is optional but recommended as it will improve accuracy and latency.
Copy an example audio file or use your own.
# Copy the sample WAV file from running the NIM container to the host machine.
docker cp riva-speech:/opt/riva/wav/es-US_sample.wav .
Translation to English using gRPC API
# Offline mode: Input speech file is sent to the service in one shot. Transcript is printed on the console.
python3 python-clients/scripts/asr/transcribe_file_offline.py --server 0.0.0.0:50051 \
--input-file es-US_sample.wav --custom-configuration source_language:es,task:translate
Translation to English using HTTP API
# Invoke the HTTP endpoint for translation.
curl -s http://localhost:9000/v1/audio/translations -F language=es -F file="@es-US_sample.wav"