quinten-kamphuis / forced-alignment

Align text to audio with exact word timings. All characters supported!

  • Public
  • 112.9K runs
  • T4
  • GitHub
  • License

Input

Video Player is loading.
Current Time 00:00:000
Duration 00:00:000
Loaded: 0%
Stream Type LIVE
Remaining Time 00:00:000
 
1x
*file
*string
Shift + Return to add a new line

Output

{ "end": 0.16045197740112993, "word": "The", "start": 0.08022598870056497 }
{ "end": 0.4011299435028248, "word": "whole", "start": 0.2807909604519774 }
{ "end": 0.6418079096045197, "word": "city", "start": 0.501412429378531 }
{ "end": 0.8223163841807909, "word": "burned", "start": 0.7019774011299434 }
{ "end": 1.083050847457627, "word": "to", "start": 0.9025423728813559 }
{ "end": 1.243502824858757, "word": "the", "start": 1.1231638418079095 }
{ "end": 1.5644067796610168, "word": "ground", "start": 1.4440677966101694 }
{ "end": 1.6847457627118643, "word": "in", "start": 1.5644067796610168 }
{ "end": 1.9655367231638416, "word": "a", "start": 1.7248587570621468 }
{ "end": 2.166101694915254, "word": "matter", "start": 1.9855932203389828 }
{ "end": 2.3466101694915253, "word": "of", "start": 2.1861581920903954 }
{ "end": 2.527118644067796, "word": "hours!", "start": 2.406779661016949 }
Generated in

Run time and cost

This model costs approximately $0.022 to run on Replicate, or 45 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia T4 GPU hardware. Predictions typically complete within 100 seconds. The predict time for this model varies significantly based on the inputs.

Readme

Forced Audio-Text Alignment

This model generates precise word-level timings from audio and text input. Feed it an audio file and its transcript, and it returns the exact timing for each word.

Example Output

[
    {
        "word": "The",
        "start": 0.0,
        "end": 0.16
    },
    {
        "word": "whole",
        "start": 0.16,
        "end": 0.32
    },
    {
        "word": "city",
        "start": 0.32,
        "end": 0.64
    }
]

Built using torchaudio’s MMS model. Supports various audio formats and includes fallback mechanisms for robust production use.