CLI tool to transcribe MP3 audio to SRT subtitles using OpenAI Whisper API
Project description
whisper-srt
CLI tool to transcribe MP3 audio files to SRT subtitle format using OpenAI Whisper API.
English | 日本語
Features
- Simple CLI for MP3 to SRT conversion
- High-accuracy transcription via OpenAI Whisper API (
whisper-1) - Built-in AI/tech terminology for better recognition
- Custom vocabulary support
Quick Start
No installation required - just run with uv:
# Set your OpenAI API key
export OPENAI_API_KEY="your-api-key"
# Transcribe (creates audio.srt)
uvx whisper-srt audio.mp3
Get your API key from OpenAI Platform.
Installation (Optional)
If you prefer a permanent install:
uv tool install whisper-srt
whisper-srt audio.mp3
Note: If you see
Executable already existserror, use--forceto overwrite:uv tool install whisper-srt --force
Upgrade
If you have whisper-srt installed, upgrade to the latest version:
uv tool upgrade whisper-srt
Usage
whisper-srt input.mp3 # Basic usage (default: English)
whisper-srt input.mp3 -o output.srt # Specify output
whisper-srt input.mp3 --language ja # Specify language (Japanese)
whisper-srt --help # See all options
Initial Setup
Run --init to configure default settings interactively:
whisper-srt --init
This command:
- Creates a vocabulary file at
~/.config/whisper-srt/vocabulary.txt - Prompts you to select a default language (saved to
~/.config/whisper-srt/language.txt)
After setup, you can skip the --language option for everyday use.
Supported Languages
Default language is English (en).
Common language codes (ISO-639-1):
| Code | Language | Code | Language |
|---|---|---|---|
en |
English | ja |
Japanese |
zh |
Chinese | ko |
Korean |
es |
Spanish | fr |
French |
de |
German | pt |
Portuguese |
See OpenAI Whisper documentation for all supported languages.
Custom Vocabulary
Create ~/.config/whisper-srt/vocabulary.txt with domain-specific terms:
YouTube
Podcast
MyCompanyName
Pricing
$0.006/minute (~$0.36/hour)
Development
git clone https://github.com/tomada1114/whisper-srt.git
cd whisper-srt
uv sync --dev
make ci # lint + type-check + test
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whisper_srt-0.4.0.tar.gz.
File metadata
- Download URL: whisper_srt-0.4.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
073c1f6ecb3d8b7e2cd26d755510f6cbfbe319d55d15143eaefcf42a5482dc7d
|
|
| MD5 |
a72557553cc8a17209ee4e8252c8ed85
|
|
| BLAKE2b-256 |
9da2af980c4b2b654f36874153e533bf3ee45a188f2353520a7e662f7b4a7b95
|
File details
Details for the file whisper_srt-0.4.0-py3-none-any.whl.
File metadata
- Download URL: whisper_srt-0.4.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9c68a6760491b9681775efce81923b4309afa7c24a69e05b4a5e6909b9caad6
|
|
| MD5 |
0b7b3c8982b5bd79bb6eb3d08f4b359e
|
|
| BLAKE2b-256 |
49e9c2bee73c214f3c50633e5bcbc0176587b70f4d8e90b564acd6916dd8f71d
|