Convert speech in audio files to text
supercontrast
is simple. You need to provide the audio file (either as a URL or a local file path) and specify the provider you want to use.
In this example, we’ll use Task.TRANSCRIPTION
with Provider.OPENAI
, which utilizes OpenAI’s Whisper API.
Task.TRANSCRIPTION
, the request schema is defined by TranscriptionRequest
and the response schema is defined by TranscriptionResponse
.
TranscriptionRequest
audio_file
: a string that can be either a URL to an audio file or a local file path.text
: a string containing the transcribed text from the audio file.