monotonic-alignment-search
Monotonically align text and speech
What it is and what it does
Monotonic Alignment Search (MAS) is a specialized algorithm extracted from the Glow-TTS text-to-speech project that solves the problem of finding the optimal alignment between a text sequence and a speech sequence. It takes two tensors—a value matrix and a mask—and returns a path indicating which text tokens correspond to which speech frames, respecting the constraint that alignments must be monotonic (never backtrack in time). The package provides two implementations: a Cython-optimized version for performance and a pure NumPy fallback for compatibility.
The package is designed for researchers and developers working on speech synthesis, voice conversion, or other audio-text alignment tasks. It depends only on NumPy at runtime, though PyTorch is required to prepare the input tensors. The implementation is extracted directly from the original Glow-TTS repository and is intended for reuse in other projects that need this specific alignment algorithm.
Use it for:
- Align text phonemes to speech frames in text-to-speech synthesis pipelines.
- Find frame-level correspondences between text and audio in voice conversion systems.
- Compute monotonic alignments for duration prediction models in speech generation.
- Prototype or extend speech synthesis models that require text-speech synchronization.
- Integrate alignment search into audio-text multimodal learning tasks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Finds the most probable alignment between a text sequence and a speech sequence using monotonic alignment search, with Cython-optimized and NumPy implementations.
Yes, if you are building or extending a text-to-speech or speech alignment system and need a standalone, well-tested implementation of monotonic alignment search. The MIT license is permissive, install friction is moderate (compiled wheels available, PyTorch must be managed separately), and there are no known security vulnerabilities. However, maintenance is minimal (aging status, 303 days since last release); use it as a stable library component rather than expecting active development or rapid bug fixes.
Install
monotonic-alignment-search on PyPI
pip
pip install monotonic-alignment-searchuv
uv add monotonic-alignment-searchpoetry
poetry add monotonic-alignment-searchInstalling monotonic-alignment-search
Before you install
Medium install friction due to compiled wheels; requires PyTorch to be installed separately (or via optional extras with uv). Last release 303 days ago with minimal maintenance activity (3 stars, aging status), but no active issues flagged.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install monotonic-alignment-search
from monotonic_alignment_search import maximum_path
path = maximum_path(value, mask, implementation="cython")
PyTorch must be installed separately; install via `uv add monotonic-alignment-search[cpu]` or `[cuda]` to include it, or install PyTorch manually first.
Verify before relying
- Whether the package is actively maintained beyond the last commit date (2025-10-15) and whether bug reports are being addressed.
- Performance characteristics and alignment accuracy compared to alternative implementations or the original Glow-TTS repository.
- Whether the NumPy implementation is suitable for production use or primarily for prototyping.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | aging — 303 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 131,042/month — #11,612 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: monotonic_alignment_search-0.2.1-cp310-cp310-macosx_11_0_arm64.whl; monotonic_alignment_search-0.2.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; monotonic_alignment_search-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl; monotonic_alignment_search-0.2.1-cp310-cp310-win_amd64.whl; monotonic_alignment_search-0.2.1-cp311-cp311-macosx_11_0_arm64.whl; monotonic_alignment_search-0.2.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; monotonic_alignment_search-0.2.1-cp311-cp311-musllinux_1_2_x86_64.whl; monotonic_alignment_search-0.2.1-cp311-cp311-win_amd64.whl; monotonic_alignment_search-0.2.1-cp312-cp312-macosx_11_0_arm64.whl; monotonic_alignment_search-0.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; monotonic_alignment_search-0.2.1-cp312-cp312-musllinux_1_2_x86_64.whl; monotonic_alignment_search-0.2.1-cp312-cp312-win_amd64.whl; monotonic_alignment_search-0.2.1-cp313-cp313-macosx_11_0_arm64.whl; monotonic_alignment_search-0.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; monotonic_alignment_search-0.2.1-cp313-cp313-musllinux_1_2_x86_64.whl; monotonic_alignment_search-0.2.1-cp313-cp313-win_amd64.whl; monotonic_alignment_search-0.2.1-cp314-cp314-macosx_11_0_arm64.whl; monotonic_alignment_search-0.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; monotonic_alignment_search-0.2.1-cp314-cp314-musllinux_1_2_x86_64.whl; monotonic_alignment_search-0.2.1-cp314-cp314t-macosx_11_0_arm64.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
whisperxWhisperX performs fast automatic speech…
permissive · top 5,000 on PyPI
TTSTTS is a deep learning library for…
copyleft · top 15,000 on PyPI
cyseqcyseq provides a Cython-optimized…
permissive · top 15,000 on PyPI
livekit-plugins-sonioxIntegrates Soniox speech-to-text and…
permissive · top 15,000 on PyPI
mlx-audioMLX-Audio provides text-to-speech,…
permissive · top 15,000 on PyPI
chatterbox-ttsChatterbox TTS converts text to speech using…
permissive · top 15,000 on PyPI
fastdtwfastdtw computes approximate Dynamic Time…
permissive · top 15,000 on PyPI
f5-ttsF5-TTS generates natural-sounding speech from…
permissive · top 15,000 on PyPI
whisper-timestampedAdds word-level timestamps and confidence…
copyleft · top 15,000 on PyPI
monotonicProvides a monotonic clock function that…
permissive · top 5,000 on PyPI