A practical guide · audio / video

From song
to karaoke.

How I separate a recording, generate timed lyrics, and bring it all together in a video you can sing along to.

01 SEPARATE THE SONG DEMUCS ↗
02 TRANSCRIBE THE VOCALS WHISPER ↗
03 TIME THE LYRICS ASS ↗
04 RENDER THE VIDEO FFMPEG ↗
ONE RECORDING   →   TWO STEMS   →   TIMED LYRICS   →   A KARAOKE VIDEO

A karaoke video is a small synchronization problem: the music, the words, and the visuals all have to arrive together.

01 / THE AUDIODEMUCS

First, separate the song.

I start by splitting the original recording into two stems with Demucs. The accompaniment becomes the final audio; the isolated voice gives me a cleaner signal for transcription and timing.

Terminal · separate stemspython -m demucs \
  --two-stems=vocals \
  -n htdemucs \
  "08 - Free Bird.mp3"

This creates vocals.wav and no_vocals.wav in a model- and track-specific directory. Separation is an estimate, so some vocal or instrumental bleed can remain.

Hear the difference

Two stems from the same Free Bird recording.

01 / Instrumental
02 / Vocals
02 / THE TRANSCRIPTIONWHISPER + PYTHON

Turn the voice into data.

I use a local tool I built, karaoke-ass, to turn the vocal stem into an editable transcription and an ASS subtitle file. Whisper estimates word timings; the tool then estimates syllable boundaries using language rules and the audio’s energy envelope.

Terminal · generate the draft./karaoke-ass \
  "separated/htdemucs/08 - Free Bird/vocals.wav" \
  --model medium --device cpu --threads 4 \
  --output results/freebird

The tool converts audio to mono at 16 kHz for recognition and processes overlapping windows. It preserves the original audio timeline, including the long instrumental opening.

transcripcion.json · excerpt{
  "text": "If",
  "start": 68.21,
  "end": 69.61,
  "language": "en",
  "probability": 0.4053974747657776
}

It also writes a readable transcript, a TSV of timing units, a review report, and execution metadata. The probability is a review signal, not proof that the word is correct.

03 / THE SUBTITLESADVANCED SUBSTATION ALPHA

Make the words move.

ASS combines styles, event timings, and karaoke tags. In the generated file, \kf progressively highlights text over a duration measured in hundredths of a second.

karaoke.ass · excerptDialogue: 0,0:01:08.21,0:01:14.06,Default,,0,0,0,,{\kf140}If{\kf82} I{\kf122} leave{\kf36} here{\k3}{\kf62} to{\kf70}mor{\kf70}row

Here, \kf140 highlights its unit over 1.40 seconds; the empty \k3 accounts for a short pause. The generated style uses white text and a yellow highlight.

Syllable boundaries are estimates, not verified phonetic alignment. Long notes, melismas, overlapping singers, and changes of language can all need manual attention.
Download the generated ASS file ↗
04 / THE EDITLISTEN & CORRECT

Listen, then refine.

I review the draft against the song and use revision.txt to find low-confidence words and unusually long intervals. A structurally valid file can still contain an incorrect lyric or a poorly timed highlight.

After editing a copy of the JSON, I can regenerate the subtitles without running Whisper again:

Terminal · rebuild from editscp results/freebird/transcripcion.json letra-corregida.json
# Edit the words and timestamps, then:
./karaoke-ass \
  "separated/htdemucs/08 - Free Bird/vocals.wav" \
  --from-json letra-corregida.json \
  --output results/freebird-corregido

The JSON can contain a source-audio hash, so I use the same vocal file for regeneration. Font, size, and timing offset can also be adjusted.

05 / THE RENDERFFMPEG + LIBASS

Bring the pieces together.

Finally, I combine the instrumental with a looping background and burn in the ASS subtitles. This example command illustrates the assembly; it is not a record of the demo’s original render command.

Terminal · render videoffmpeg \
  -stream_loop -1 -i background-loop.mp4 \
  -i "separated/htdemucs/08 - Free Bird/no_vocals.mp3" \
  -vf "ass=results/freebird/karaoke.ass" \
  -map 0:v:0 -map 1:a:0 \
  -c:v libx264 -pix_fmt yuv420p \
  -c:a aac -b:a 192k -shortest \
  freebird-karaoke.mp4

The loop repeats the background, the ASS filter renders the text, and -shortest ends the output with the audio. FFmpeg needs libass support for the subtitle filter.

06 / WATCH THE RESULT

Ready to sing.

The finished Free Bird karaoke video, compressed for web playback. Use the player controls to watch and listen.

Download demo video ↗
07 / REFERENCESSOURCE MATERIAL

References & resources.

Documentation and source code for the tools and formats used in this workflow.