Real-time transcription
Stream audio and receive real-time transcript using Soniox Speech-to-Text API.
Soniox Speech-to-Text Real-time API allows you to transcribe live audio streams with high accuracy and low latency. By streaming your audio data to our WebSocket API, you can receive transcripts back in real-time.
Get API key
Create a free Soniox Account and login into Soniox Console to create an API key.
Note: API keys are bound to projects - click on "API keys" under "My First Project" section to create one.
Configure environment
Store the API key in the SONIOX_API_KEY
environment variable to prevent accidental exposure.
Note: Alternative is to put the API key in .env file, if you already have it configured.
Real-time transcription
This example will open a local audio file and stream it to our WebSocket API. You can replace the local audio file with another real-time audio source (e.g. microphone).
You can prepare an example PCM (raw) file using ffmpeg
:
Or download an example file here:
Output