nyra forced aligner (multilingual)
Precise word timing for real speech in 16 languages, and the only forced aligner that puts exact timestamps on vocal sound events: fillers, laughter, breaths, coughs and cut-off words.
Blog post Β· Paper Β· Code Β· PyPI Β· CrisperWhisper
A forced aligner answers one question: given a recording and its transcript,
when was each word said? Most aligners were built for read speech and clean
audio, and they quietly fall apart on the material people actually need to
align: conversations full of ums, laughter, restarts and half-finished words,
recorded in rooms that are not studios.
This model was built for exactly that material.
- Vocal sound events are aligned, not smeared. Other aligners have no way
to represent a laugh, a breath or an
um: the sound is either dropped or absorbed into the neighbouring words, which pushes their boundaries off. Here fillers ([UH],[UM]), laughter, breaths, sighs, coughs, sniffs, lip smacks, throat clearing, yawns and word cut-offs (th-) are units of the acoustic model like any phone, in every language. Each one gets a start and an end time of its own. - Made for CrisperWhisper transcripts. Trained on the verbatim transcription convention of CrisperWhisper 2.0: feed its output straight in and every filler, repetition and event token is aligned.
- 16 languages, one backbone. One shared XLS-R encoder and a 5-12 MB model folder per language. The encoder is downloaded and loaded once, however many languages you use.
- Accurate on conversational speech. 18.4 ms mean word-boundary error on Buckeye, the lowest of any forced aligner we have measured.
- Robust to noise. With the built-in voice isolator (
denoise=True) the same model stays accurate on noisy and reverberant recordings. - Fast and longform. About 600x real time on one GPU: a 20 s clip aligns in about 30 ms. Any audio length works in one call.
Install
pip install nyra-forced-aligner
pip install "nyra-forced-aligner[ja]" # Japanese (MeCab)
pip install "nyra-forced-aligner[denoise]" # voice isolator for noisy audio (CUDA)
Runs on CPU, but a CUDA GPU is strongly recommended. The shared backbone (about 0.5 GB) and the folder of the language you ask for are downloaded from this repository on first use.
Quickstart
from nyra_align import Aligner
aligner = Aligner() # English
# aligner = Aligner(language="de") # any of the 16 languages
# aligner = Aligner(denoise=True) # noisy audio
result = aligner.align("interview.wav",
"so i [UM] i went there on on thursday [laughter]")
for w in result.words:
print(f"{w.start:7.3f} {w.end:7.3f} {w.word:<12s} {w.type}") # w / f(iller) / s(ound) / c(ut-off)
result.to_textgrid("interview.TextGrid") # Praat
result.to_json("interview.json")
Output (illustrative):
0.410 0.580 so w
0.580 0.660 i w
0.660 1.120 [UM] f
1.240 1.330 i w
1.330 1.560 went w
...
2.870 3.640 [laughter] s
Every word also carries its phones and a confidence between 0 and 1.
result.events returns just the fillers, sounds and cut-offs,
result.silences the pauses between words.
Command line, single file or a whole corpus of paired .wav + .txt/.lab
files (MFA-style layout):
nyra-align interview.wav --text-file interview.txt --out interview.TextGrid
nyra-align corpus_dir/ --language de --denoise --out-dir aligned/ --format textgrid
Noisy audio
For noisy, reverberant or phone recordings, switch on the built-in voice isolator. It cleans the audio before alignment; the timestamps refer to the original recording.
from nyra_align import Aligner
aligner = Aligner(language="en", denoise=True) # needs a CUDA GPU
result = aligner.align("street_interview.wav",
"yeah so [UM] we we moved here in two thousand nine [laughter]")
for w in result.words:
print(f"{w.start:7.3f} {w.end:7.3f} {w.word:<12s} {w.type} {w.confidence:.2f}")
pip install "nyra-forced-aligner[denoise]"
nyra-align street_interview.wav --text-file street_interview.txt --denoise --out street_interview.TextGrid
The isolator is loaded once per process and shared by every Aligner, so
several languages can run with denoise=True side by side. On clean audio it
changes the result very little (see Under noise), so leave it
off there and save the time: alignment alone runs at about 600x real time,
with the isolator at about 60x.
Vocal sound events
The transcript tells the aligner what to place, so it should be verbatim: write what you hear.
| In the audio | Write | Type in the result |
|---|---|---|
| Filled pauses | [UH], [UM] |
f |
| Laughter, breath, sigh, cough, sniff, lip smack, throat clearing, yawn, sneeze | [laughter], [breath], [sigh], [cough], [sniff], [lipsmack], [throatclearing], [yawn], [sneeze] |
s |
| Interrupted words and fragments | trailing hyphen: th-, w-, resched- |
c |
| Everything else | word for word, repetitions and false starts included | w |
so we we need to, to reschedule the th- Thursday meeting to [UH] March third at nine thirty [laughter]
Normal casing and punctuation are fine; the aligner ignores both. Numbers,
dates and times are written out as spoken. A word that was spoken but is
missing from the transcript gets absorbed into its neighbours, and a word that
was never spoken is squeezed into a few frames, so both shift the surrounding
boundaries. A tag the model does not know ([music]) is left out and listed
in result.skipped. English additionally knows [noise], [crying] and
[scream].
With CrisperWhisper 2.0
CrisperWhisper 2.0 produces transcripts in exactly this convention: it writes down fillers, repetitions, cut-offs and vocal events as they were said. Its verbatim output can be aligned as is, which gives every word and every sound event a precise start and end:
from crisperwhisper import CrisperWhisperModel
from nyra_align import Aligner
audio = "interview.wav"
transcript = CrisperWhisperModel("large").transcribe(audio, language="en").text
# "so i [UM] i went there on on thursday [laughter]"
result = Aligner(language="en").align(audio, transcript)
for w in result.events: # fillers, laughter, cut-offs
print(f"{w.start:7.3f} {w.end:7.3f} {w.word}")
result.to_textgrid("interview.TextGrid")
pip install "crisperwhisper[transformers]" nyra-forced-aligner
For another language, pass the same language to both.
Languages
| Language | Code | Pronunciations | Size |
|---|---|---|---|
| English | en |
lexicon + eSpeak | 6 MB |
| German | de |
dictionary + eSpeak | 12 MB |
| French | fr |
eSpeak + unit map | 5 MB |
| Spanish | es |
eSpeak + unit map | 5 MB |
| Italian | it |
eSpeak + unit map | 5 MB |
| Dutch | nl |
eSpeak + unit map | 5 MB |
| Polish | pl |
eSpeak + unit map | 6 MB |
| Portuguese | pt |
eSpeak + unit map | 5 MB |
| Russian | ru |
eSpeak + unit map | 8 MB |
| Swedish | sv |
NST lexicon + eSpeak | 10 MB |
| Danish | da |
NST lexicon + eSpeak | 7 MB |
| Turkish | tr |
eSpeak + unit map | 6 MB |
| Ukrainian | uk |
spelling rules + eSpeak | 7 MB |
| Greek | el |
eSpeak + unit map | 5 MB |
| Japanese | ja |
MeCab + kana rules | 5 MB |
| Korean | ko |
hangul rules + eSpeak | 7 MB |
All 16 share xlsr/ (458 MB). Aligner(language=...) downloads that folder
once plus the folder of the language; several Aligner objects in one process
share one backbone in memory. Words outside a language's lexicon are
pronounced by the language's own grapheme-to-phoneme rules, the same ones used
in training.
Performance (English)
Measured with the nyra speech timing benchmark on three test sets with hand-labelled word boundaries: Buckeye (conversational, 2,008 recordings, 80k words), TIMIT (read sentences, 1,626 recordings, 14k words) and FluencyBank (stuttered speech, 300 recordings, 5.5k words). Every system gets the reference transcript and is scored with the same protocol. MAE is the mean absolute word-boundary error; β€ t ms is the share of words whose boundaries are within t of the reference (F1 at that collar).
Buckeye (conversational speech)
| System | MAE (ms) | β€25 ms | β€50 ms | β€100 ms |
|---|---|---|---|---|
| nyra forced aligner (this model) | 18.4 | 65.7% | 90.7% | 97.9% |
nyra forced aligner + voice isolator (denoise=True) |
18.9 | 65.7% | 90.6% | 97.9% |
Montreal Forced Aligner english_us_arpa, wide beam |
25.3 | 61.3% | 86.7% | 95.6% |
| Qwen3-ForcedAligner-0.6B | 39.4 | 28.7% | 74.9% | 94.3% |
| MMS-FA (torchaudio) | 52.7 | 15.2% | 49.9% | 86.5% |
| WhisperX (wav2vec2 alignment) | 89.8 | 0.9% | 7.9% | 48.6% |
TIMIT (read speech)
| System | MAE (ms) | β€25 ms | β€50 ms | β€100 ms |
|---|---|---|---|---|
| nyra forced aligner (this model) | 18.5 | 60.5% | 86.5% | 97.9% |
nyra forced aligner + voice isolator (denoise=True) |
18.5 | 60.5% | 86.6% | 97.9% |
Montreal Forced Aligner english_us_arpa, wide beam |
18.6 | 58.3% | 84.5% | 96.9% |
| Qwen3-ForcedAligner-0.6B | 30.1 | 26.6% | 70.8% | 95.0% |
| MMS-FA (torchaudio) | 37.3 | 17.4% | 51.3% | 93.2% |
| WhisperX (wav2vec2 alignment) | 64.8 | 2.8% | 13.3% | 59.5% |
FluencyBank (stuttered speech)
| System | MAE (ms) | β€25 ms | β€50 ms | β€100 ms |
|---|---|---|---|---|
| nyra forced aligner (this model) | 73.7 | 34.4% | 70.4% | 87.2% |
nyra forced aligner + voice isolator (denoise=True) |
75.0 | 32.0% | 69.3% | 86.3% |
Montreal Forced Aligner english_us_arpa, wide beam |
121.5 | 28.7% | 58.2% | 76.3% |
| Qwen3-ForcedAligner-0.6B | 109.4 | 14.3% | 44.6% | 73.7% |
| MMS-FA (torchaudio) | 154.8 | 12.1% | 37.5% | 65.0% |
| WhisperX (wav2vec2 alignment) | 171.8 | 2.3% | 7.5% | 39.6% |
Under noise
The same three sets with white Gaussian noise added, from 30 dB down to 0 dB signal-to-noise ratio, without and with the voice isolator. Each cell is MAE in ms / share of words within 50 ms.
| Set | Voice isolator | clean | 30 dB | 20 dB | 10 dB | 5 dB | 0 dB |
|---|---|---|---|---|---|---|---|
| Buckeye | off | 18.4 / 91% | 18.4 / 91% | 18.7 / 90% | 22.9 / 88% | 32.0 / 81% | 73.4 / 65% |
| Buckeye | on | 18.9 / 91% | 18.8 / 91% | 18.9 / 90% | 20.6 / 89% | 24.3 / 86% | 34.0 / 80% |
| TIMIT | off | 18.5 / 87% | 18.4 / 86% | 18.4 / 87% | 19.9 / 84% | 23.8 / 79% | 38.4 / 63% |
| TIMIT | on | 18.5 / 87% | 18.5 / 86% | 18.5 / 86% | 19.2 / 86% | 20.9 / 83% | 26.4 / 75% |
| FluencyBank | off | 73.7 / 70% | 72.7 / 70% | 76.3 / 69% | 90.5 / 62% | 109.5 / 53% | 166.3 / 37% |
| FluencyBank | on | 75.0 / 69% | 77.1 / 68% | 76.6 / 67% | 79.9 / 66% | 90.9 / 62% | 113.4 / 54% |
Aligner(denoise=True) runs the
Inworld Voice Isolator
(Apache-2.0) on the audio before the features are extracted, through a faster
inference path with the same weights (about 60x real time on one GPU). The
weights are part of this repository (isolator/, 256 MB) and are downloaded
the first time denoising is used. It needs a CUDA GPU and
pip install "nyra-forced-aligner[denoise]".
TIMIT under the same noise next to other forced aligners:
| Mean absolute error (ms) | 30 dB | 20 dB | 10 dB | 5 dB | 0 dB |
|---|---|---|---|---|---|
| nyra forced aligner + voice isolator | 18.5 | 18.5 | 19.2 | 20.9 | 26.4 |
| nyra forced aligner | 18.4 | 18.4 | 19.9 | 23.8 | 38.4 |
Montreal Forced Aligner english_us_arpa, wide beam |
17.9 | 20.7 | 39.5 | 71.6 | 152.4 |
| Qwen3-ForcedAligner-0.6B | 29.5 | 30.4 | 44.6 | 74.5 | 124.0 |
| MMS-FA (torchaudio) | 37.4 | 37.6 | 38.3 | 39.4 | 43.5 |
| WhisperX (wav2vec2 alignment) | 68.2 | 70.8 | 76.4 | 95.9 | 316.2 |
| Words within 50 ms / within 100 ms | 30 dB | 20 dB | 10 dB | 5 dB | 0 dB |
|---|---|---|---|---|---|
| nyra forced aligner + voice isolator | 86.5% / 97.8% | 86.4% / 97.8% | 85.5% / 97.3% | 83.0% / 96.1% | 75.4% / 91.9% |
| nyra forced aligner | 86.5% / 97.9% | 86.7% / 97.8% | 84.5% / 96.6% | 79.0% / 93.5% | 62.6% / 83.2% |
Montreal Forced Aligner english_us_arpa, wide beam |
85.7% / 96.7% | 81.5% / 93.7% | 59.1% / 80.8% | 40.2% / 63.7% | 19.9% / 37.9% |
| Qwen3-ForcedAligner-0.6B | 72.3% / 95.3% | 70.8% / 94.2% | 51.5% / 82.5% | 29.7% / 60.7% | 13.2% / 34.6% |
| MMS-FA (torchaudio) | 51.1% / 93.1% | 50.8% / 93.0% | 50.3% / 92.1% | 49.5% / 90.8% | 46.9% / 86.6% |
| WhisperX (wav2vec2 alignment) | 12.2% / 56.7% | 11.1% / 54.3% | 8.9% / 49.2% | 6.1% / 40.0% | 1.6% / 14.1% |
Options
| Option | What it does |
|---|---|
Aligner(language="de") |
One of the 16 languages; the backbone is shared between them |
Aligner(denoise=True) |
Voice isolator on the audio before alignment |
Aligner(device="cuda" / "cpu") |
Device selection (auto by default) |
Aligner(precision="fp32") |
Backbone in fp32 instead of fp16 |
Aligner(wavlm_batch=16) |
Batch size for the 30 s backbone windows on long audio (tune to VRAM) |
aligner.align_features(feats, text) |
Re-align a transcript against cached features |
w.confidence |
0-1 per word: how well the audio under the word fits it. Low values point at transcript errors and at words displaced by untranscribed speech next to them |
result.events |
Just the filler / sound / cut-off tokens |
result.silences |
Silence segments between words |
nyra_align.available_languages() |
The languages in the repository |
NYRA_ALIGN_MODELS=/path/to/repo |
Use a local copy of this repository instead of the Hub |
Word confidence. Per 10 ms frame the aligner compares the likelihood of the sound it placed there with that of the best-fitting sound of the whole model, and maps the mean gap over the word's frames to a value between 0 and
- A word that really is where it was placed scores close to 1; a transcription error, or a correct word pushed onto the wrong audio, scores close to 0. Look at runs rather than single words: one low word in a fluent stretch is usually a fast or reduced word, several in a row point at speech the transcript leaves out or gets wrong. It is a fit score to rank and filter by, not a probability, and it does not change the timestamps.
Long recordings. Any length works in one call. The audio is processed in 30 s windows that are stitched on the exact frame grid, so timestamps do not drift: an hour aligned in one call is as accurate as the same hour aligned in 15 s pieces.
How it works
Hidden states of a frozen XLS-R encoder (layers 18, 8 and 14) are projected by a supervised LDA onto 40 dimensions and modelled by a triphone GMM-HMM whose inventory holds the vocal-event units next to the language's phones. For a transcript the package builds the alignment graph (optional silence between words, full context across word boundaries) and runs a compiled beam Viterbi over the model's likelihoods, with a beam ladder so that no utterance is ever silently dropped. There is no Kaldi or other external toolkit at inference.
Repository layout:
languages.json the languages available
xlsr/ shared backbone: XLS-R 300M, layers 1-18 of 24, fp16
isolator/ voice isolator weights, downloaded only for denoise=True
<language>/ meta.json, model.npz, lexicon.txt, pronunciation data
Limitations
- The transcript has to match the audio. Missing or extra words shift the
boundaries around them;
confidenceflags such places. - Accuracy is reported for English only.
- The voice isolator needs a CUDA GPU.
License
The model files in this repository are released under the nyra health Non-Commercial Research License: free for research and other non-commercial use. The license covers the model and the alignments it produces: any commercial use of the timestamps, and any use of them to train, fine-tune or otherwise improve models intended for commercial use, requires a commercial license. Contact nyra health.
The inference code (nyra-forced-aligner) is MIT-licensed. xlsr/ is a
shortened copy of facebook/wav2vec2-xls-r-300m (Apache-2.0); isolator/
holds the unchanged Inworld Voice Isolator v1 weights (Apache-2.0, Β© Inworld
AI, with their LICENSE and NOTICE); the Swedish and Danish pronunciation
lexica derive from the NST lexica (CC0).
Model tree for nyralabs/nyra_forced_aligner_multilingual
Base model
facebook/wav2vec2-xls-r-300m