Transcribe short audio
Learn how to transcribe short audio with Soniox Speech-to-Text (legacy).
Make sure you have completed Quickstart step before proceeding with this guide.
In this example, we will transcribe a short audio file and print out the result.
We create a SpeechClient
object which handles all the communication between your program and Soniox.
We use the with
statement to cleanup the client
object after it is no longer needed.
We then call the transcribe_file_short()
function with the created client
object and a short audio
file test_audio.flac
(part of soniox_examples GitHub repository).
The function reads the entire audio file and sends it to Soniox for transcription.
It returns an instance of the Result
structure, which contains the recognized tokens.
Each token is an instance of the Word
structure, which contains the text of the recognized token as well as its timestamps.
Run
Output