Skip to main content

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 exists error, use --force to 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:

  1. Creates a vocabulary file at ~/.config/whisper-srt/vocabulary.txt
  2. 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

whisper_srt-0.4.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whisper_srt-0.4.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file whisper_srt-0.4.1.tar.gz.

File metadata

  • Download URL: whisper_srt-0.4.1.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

Hashes for whisper_srt-0.4.1.tar.gz
Algorithm Hash digest
SHA256 0becfef659f906b61e65055080a9638b1670b52437d3032342fee803047c76b3
MD5 1b7d7239c68e15f484bbea920a008667
BLAKE2b-256 cf44e2bb1010cdc82a337821588fb8e77a34838a40b35fcbc0cbb94eef803d2d

See more details on using hashes here.

File details

Details for the file whisper_srt-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: whisper_srt-0.4.1-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

Hashes for whisper_srt-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38713e95718027c81b519d53214df07226cc32c543fe739a45ebdab881cb3268
MD5 b3c8b01f3cbfb81c0943f8be387d0d1c
BLAKE2b-256 8c10b0480306d3e618ec661d7d417525051463790770153ddabee9219bcfdb2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page