gitwtfhub

wtf is srt-to-voice?

kostja-me/srt-to-voice — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · generalComplexity · 2/5LicenseSetup · easy

TL;DR

A command line Python script that converts .srt subtitle files into per-line MP3 voice clips using the ElevenLabs text to speech API.

Mindmap

mindmap
  root((srt-to-voice))
    What it does
      Reads srt subtitle files
      Calls ElevenLabs API
      Writes numbered MP3 files
    Tech stack
      Python
      uv
      httpx
      ElevenLabs API
    Use cases
      Voice over subtitle files
      Preview with dry run
      Resume interrupted batches
    Audience
      Video editors
      Content creators

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Turn a subtitle file into a folder of numbered voice clips for a video.

REASON 2

Preview what audio would be generated without spending API credits using dry run mode.

REASON 3

Resume a large batch job that got interrupted without redoing finished clips.

REASON 4

Apply a pronunciation dictionary to control how specific words are spoken.

What's in the stack?

PythonuvhttpxElevenLabs API

How it stacks up

kostja-me/srt-to-voice0xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultyeasyhardhard
Complexity2/54/54/5
Audiencegeneraldeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires an ElevenLabs account and API key with text to speech access enabled.

MIT licensed, free to use, modify, and share for any purpose including commercial use.

Wtf does this do

srt-to-voice is a small Python script that turns subtitle files into spoken audio. You give it an .srt file, the kind that carries timed captions for a video, and it sends the text of each subtitle line to the ElevenLabs text to speech service, saving the result as a separate MP3 file. Each cue gets its own numbered file, like 001.mp3, 002.mp3, and so on, so the clips stay in the right order. If you add the timestamp option, the filenames also include the cue's start time, which makes it easier to line the audio back up with the original subtitles later. To use it you need a tool called uv, which handles installing Python and the script's one dependency automatically, so setup is mostly just running one install command. You also need an ElevenLabs account and an API key with text to speech access turned on, plus a voice id chosen from ElevenLabs' voice library. Both the API key and voice id can be set as environment variables so you do not have to type them every time. The script supports a few extra options. A dry run mode lets you preview what would be generated without actually calling the API or spending any credits. By default it skips cues that already have an MP3 file, so if a run gets interrupted you can start it again and it will only fill in the missing pieces instead of redoing everything. You can also choose between different ElevenLabs voice models, trading off speed against quality, and apply a pronunciation dictionary if you want specific words pronounced a certain way. This is a focused, single-purpose command line tool rather than a full application. There is no bundled server, database, or user interface, just a script you run from a terminal with a subtitle file as input and a folder of MP3 files as output. It is released under the MIT license.

Yoink these prompts

Prompt 1
Walk me through installing uv and running srt-to-voice on my first subtitle file.
Prompt 2
Explain how to get an ElevenLabs API key with the right permissions for this script.
Prompt 3
Show me how to use the timestamp option to keep audio clips lined up with subtitles.
Prompt 4
Help me set up a pronunciation dictionary for words this script mispronounces.

Frequently asked questions

wtf is srt-to-voice?

A command line Python script that converts .srt subtitle files into per-line MP3 voice clips using the ElevenLabs text to speech API.

What language is srt-to-voice written in?

Mainly Python. The stack also includes Python, uv, httpx.

What license does srt-to-voice use?

MIT licensed, free to use, modify, and share for any purpose including commercial use.

How hard is srt-to-voice to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is srt-to-voice for?

Mainly general.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.