Skip to main content

ASRX Logo

ASRX: Universal Forced Alignment & Speech Segmentation

ASRX is a high-performance, model-agnostic Forced Alignment, VAD Segmentation, and Speaker Diarization engine.

It allows developers to take text generated by ANY external ASR model, LLM, or API (e.g. Cohere, Qwen, Whisper, vLLM, OpenAI, Deepgram, or custom local scripts) and immediately generate:

  • ⏱️ Exact millisecond-level word timestamps (start, end)
  • 🎯 Word-level confidence scores
  • 🎙️ VAD-guided natural speech segment grouping
  • 👥 Speaker Diarization
  • ⚡ Ultra-fast processing

🚀 Quickstart

1. Installation

ASRX uses a lazy-loaded backend architecture. You only install the heavy ML dependencies for the specific models you want to use.

# Core installation (fast, no heavy dependencies)
pip install -e asrx

# 1. Install for Wav2Vec2/MMS alignment (Recommended)
pip install -e asrx[transformers]

# 2. Install for Pyannote VAD and Diarization
pip install -e asrx[pyannote]

# 3. Install for NVIDIA NeMo (Aligner, VAD, Sortformer)
pip install -e asrx[nemo]

# 4. Install for CTC-Segmentation (Confidence scores)
pip install -e asrx[ctc,transformers]

2. Standalone Alignment in 1 Line (asrx.align)

import asrx

audio_file = "meeting.wav"
my_text = "I don't have a problem with where we go, the most important thing is that the place is quiet, has good coffee, and we can sit comfortably and talk."

# Generates word timestamps, confidence scores, and VAD-guided segments
result = asrx.align(
    audio=audio_file,
    text=my_text,
    language="en",
    aligner="wav2vec2", # "wav2vec2", "mms", "nemo", "ctc_segmentation"
    vad="silero"        # "silero", "pyannote", "nemo", "flashvad"
)

print("Total words aligned:", len(result["word_segments"]))
print("First word timestamp:", result["word_segments"][0])

🧰 Backend Registry

Because ASRX is entirely modular, you can mix and match the best tools for your specific use case.

Alignment Backends (aligner=...)

Key Description Pros Install Required
"wav2vec2" HuggingFace Wav2Vec2 (Default) Fast, built-in dicts for 40 langs transformers
"mms" Meta MMS (1B params) Supports 1,107+ languages transformers
"nemo" NVIDIA NeMo Forced Aligner Viterbi CTC, highly optimized nemo_toolkit[asr]
"ctc_segmentation" CTC-Segmentation Algorithm Provides per-word confidence flags ctc-segmentation

VAD Backends (vad=...)

Key Description Pros Install Required
"silero" Silero VAD (Default) Fast, works out of the box (Torch Hub) None
"pyannote" Pyannote VAD Best accuracy in noise pyannote.audio
"nemo" NVIDIA MarbleNet Fast and accurate nemo_toolkit[asr]
"flashvad" FlashVAD Ultra-lightweight (~46K params) flashvad

Diarization Backends (diarize=...)

Key Description Pros Install Required
"pyannote" Pyannote Diarization (Default) Industry standard, clustering pyannote.audio
"sortformer" NVIDIA NeMo Sortformer SOTA for overlapping speech nemo_toolkit[asr]

🛠️ Advanced Usage

1. Alignment with SOTA Diarization (NeMo Sortformer)

import asrx

result = asrx.align(
    audio="panel_discussion.wav",
    text=transcript_text,
    language="en",
    vad="nemo",
    diarize="sortformer"
)

# Words and segments will have "SPEAKER_00", "SPEAKER_01", etc.
for seg in result["segments"]:
    print(f"[{seg['speaker']}] {seg['start']}s -> {seg['end']}s: {seg['text']}")

2. Custom Pyannote Models (e.g., Community-1)

result = asrx.align(
    audio="audio.wav",
    text=my_text,
    language="ar",
    diarize="pyannote",
    model_name="pyannote/speaker-diarization-community-1",
    hf_token="your_hf_token"
)

3. Reusable Pipeline for High-Throughput Batching

import asrx

# Load pipeline once into memory
pipeline = asrx.load_aligner(
    language="en",
    aligner="mms",
    vad="pyannote",
    diarize="sortformer",
    device="cuda",
    hf_token="your_hf_token"
)

# Process multiple audio files efficiently
for audio_path, text in dataset:
    result = pipeline.align(audio=audio_path, text=text)

📊 Standardized JSON Output

{
  "segments": [
    {
      "start": 0.12,
      "end": 7.15,
      "text": "I don't have a problem with where we go, the most important thing is that the place is quiet.",
      "speaker": "SPEAKER_00",
      "words": [
        {
          "word": "I",
          "start": 0.12,
          "end": 0.34,
          "score": 0.769,
          "speaker": "SPEAKER_00"
        },
        {
          "word": "don't",
          "start": 0.381,
          "end": 0.461,
          "score": 0.976,
          "speaker": "SPEAKER_00"
        }
      ]
    }
  ],
  "word_segments": [
    {
      "word": "I",
      "start": 0.12,
      "end": 0.34,
      "score": 0.769,
      "speaker": "SPEAKER_00"
    },
    {
      "word": "don't",
      "start": 0.381,
      "end": 0.461,
      "score": 0.976,
      "speaker": "SPEAKER_00"
    }
  ],
  "language": "en"
}

🌍 Supported Alignment Languages

Supports Arabic (ar), English (en), French (fr), German (de), Spanish (es), Italian (it), Japanese (ja), Chinese (zh), Portuguese (pt), Russian (ru), Turkish (tr), Hindi (hi), Korean (ko), and 1000+ other languages via MMS and Multilingual models.


📄 License

Apache-2.0

Metadata

Release files for asrx 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asrx 0.3.2
File Size Uploaded Provenance
asrx-0.3.2.tar.gz 48.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for asrx 0.3.2
File Interpreter ABI Platform
asrx-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 104.8 kB

Release files / asrx-0.3.2.tar.gz

Download URL asrx-0.3.2.tar.gz
Size 48.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2ec9d7d1c2f6da58a7300b2e99d0df2ddabb44eb06e9824399ec64011904a167
BLAKE2b-256 checksum
How to use checksums
75aade467845cbff172ea88e1c30ba94ea4c75e9026ff5195154deb3ab0ff639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / asrx-0.3.2-py3-none-any.whl

Download URL asrx-0.3.2-py3-none-any.whl
Size 56.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8370baccd41c2785df1739ce795411f44edf1c4f9ffa1005a2c561ded622c951
BLAKE2b-256 checksum
How to use checksums
4ed91060e8dec54e0b12cbe916507a648e76e531d756a8234ece1398dcee1c04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Security for asrx 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for asrx-0.3.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page