AI & MLOpenAIPython

Transcribing and Translating Audio with Whisper

I wanted to be able to search a recording for something someone had said. For speech in another language, I also wanted the option of an English text version. I tried the two tasks in separate scripts so I could choose the output I needed.

The two MP3 scripts both use whisper-1. One passes the open file to client.audio.transcriptions.create and prints the transcript. The other calls client.audio.translations.create and prints the translation.

Transcription and translation

Transcription turns speech into text. Translation changes the language of the resulting text as well. That difference matters when deciding what counts as a faithful record.

For a transcript, I would want to inspect names, numbers, technical terms, and unclear passages against the original audio. For a translation, I would also want to preserve the source language and recognize that translated wording is another interpretation layer.

The retained scripts contain the API calls; they are historical examples rather than current SDK installation instructions.

From a file to a reviewable record

The useful workflow is larger than the request itself. An application needs to preserve which audio file produced which text, handle failed or partial processing, and give a reviewer a way to return to the relevant recording.

That becomes important if the text later enters a search system or timeline. An error in the first transcript can otherwise look like a confident fact several processing steps later.

Where this fits in the history

OpenAI introduced Whisper in September 2022. The retained scripts show the practical appeal of speech recognition and translation becoming accessible application components.

My earlier debate-analysis project used managed cloud transcription. These smaller experiments continue that theme with a different speech-model interface.

Related post