skillfed

monotonic-alignment-search

Monotonically align text and speech

monotonic-alignment-search v0.2.1 131.0K downloads/30d#11,612 on PyPI3
Permissive license MIT AGING released

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-search

uv

uv add monotonic-alignment-search

poetry

poetry add monotonic-alignment-search

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Multimedia :: Sound/Audio :: SpeechTopic :: Software Development :: Libraries :: Python Modules

Tags

text to speech alignmentmonotonic alignment searchsequence alignment audiospeech text synchronizationglow-tts alignmentdynamic time warping alternativeaudio text matching
speech-synthesisaudio-alignmentsequence-matching

More Python Modules packages