Important
Transcribe Ukrainian with translation to English text to SRT format. OpenAI transcription/translation API Endpoints
Leverages the OpenAI API to transcribe audio files and translate the transcriptions into English and Ukrainian SRT (SubRip subtitle) files. Using OpenAI's Whisper model, specifically targets Ukrainian language audio for transcription. This tool is designed to handle audio files directly, manage file size constraints by splitting large files, and process both the transcription and translation phases automatically.
- transcribe_ukrainian.sh: Converts audio to text using the Whisper model, with a focus on Ukrainian audio content.
- translation_to_english.sh: Translates audio to English text using the Whisper model.
- File Size Management: Splits files larger than 25MB into smaller segments to comply with API limitations.
- Automated Workflow: From a single audio file input, produces an SRT file containing both transcribed and translated text.
- Bash shell (Linux, macOS)
curl
for making API requestsffmpeg
for splitting large audio files into manageable segmentsjq
for parsing JSON responses
- Ensure all required tools (
curl
,ffmpeg
,jq
) are installed on your system. - Place the script in a desired directory.
- Open a terminal and navigate to the directory containing the script.
- Make the script executable with the following command:
chmod +x run.sh
- Run the script by providing the path to the audio file as an argument:
bash ./run.sh /path/to/your/audio_file.mp3
- When prompted, enter your OpenAI API key. This key is required to authenticate API requests for transcription and translation.
- The script is designed to work with audio files specifically in the Ukrainian language for the initial transcription process. Adjustments may be needed for other languages.
- API costs: Using the OpenAI API for transcription and translation may incur costs. Please check the current OpenAI pricing and your usage quota before running the script.
- The script generates two main outputs:
- A
.json
file with the transcribed text in Ukrainian. - An
.srt
file with both the original Ukrainian transcription and the appended English translation, ready for use as subtitles.