Skip to main content

Sawalign

Multilingual forced alignment for word timestamps and subtitles.

Give Sawalign an audio recording and its transcript. Get word timings and SRT captions for subtitle editors, audio players and speech datasets.

Built by Omneity Labs, powered by Sawtone, and available through Sawalni API.

Quick start

pip install sawalign

Create a Sawalni API key, enable alignment access, then set it in your terminal. API requests use credits.

export SAWALNI_API_KEY="your-key"
sawalign align interview.wav --text transcript.txt --output captions.srt

Use your own audio recording and a transcript that matches what is spoken. The package calls the hosted API; it does not download model weights or run the engine locally.

Languages and scripts

100+ core languages, with extended compatibility across 400+ languages. Built on Sawtone, Sawalign works across languages and scripts, including Darija and Amazigh in Arabic, Latin and Tifinagh.

Keep your transcript in the language and script of the audio recording, including language switches. There is no need to translate it into English. Alignment quality can vary by language, accent and audio quality, particularly beyond the core languages.

Python

from pathlib import Path
from sawalign import Sawalign

text = Path("transcript.txt").read_text(encoding="utf-8")

with Sawalign() as client:
    job = client.submit("interview.wav", text)
    print(job["job_id"])  # Save this ID to resume without another upload.
    result = client.wait(job["job_id"])
    words = result.get("words_so_far", [])
    Path("captions.srt").write_text(
        client.srt(job["job_id"]), encoding="utf-8"
    )

The same call accepts a Darija, Amazigh, Arabic, French or other matching transcript. The client has no language selector; it sends your text as supplied.

Where it fits

  • Subtitles: time an edited transcript and export SRT.
  • Audio players: use word timestamps to highlight the text as speech plays.
  • Speech datasets: attach word boundaries to an existing transcript.
Audio recording ──┐
                  ├── Sawalign API ── Job ID ── Word timings / SRT
Reviewed text ────┘

Sawalign aligns the words you supply. Need a transcript in Darija, Amazigh or other major languages? Check out Daktilo, then review its transcript before alignment. The Python and TypeScript starter includes this workflow and a real Darija demo with saved text and timings.

Submit now, retrieve later

sawalign submit interview.wav --text transcript.txt
sawalign status JOB_ID
sawalign wait JOB_ID
sawalign srt JOB_ID > captions.srt

A job ID lets you resume polling after a terminal disconnect or a client timeout. It avoids uploading the same audio recording again.

Client reference

Method Result
submit(audio, text) Upload once; return the job ID and state.
status(job_id) Current state and available word timings.
wait(job_id, timeout=600, poll_interval=2) Wait for completion; return the final job.
srt(job_id) SRT captions as a string.
align(audio, text) Submit and wait in one call.

AlignmentTimeout.job_id lets you resume a timed-out wait. AlignmentFailed.job contains the terminal response. HTTP errors use httpx.HTTPStatusError; transport errors use httpx.RequestError. Uploads are not retried automatically. After an uncertain upload, check the service before submitting again.

Audio recording limit: 128 MiB. Transcript limit: 1,000,000 UTF-8 bytes. Keep the API key in a server environment.

API reference · Runnable starter · Sawtone

Python 3.10 or later. MIT license.

Metadata

Release files for sawalign 0.1.1

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

Source distribution (sdist)

Source distribution for sawalign 0.1.1
File Size Uploaded Provenance Actions
sawalign-0.1.1.tar.gz 7.3 kB With provenance Details for sawalign-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 14.2 kB

Release files / sawalign-0.1.1.tar.gz

Download URL sawalign-0.1.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9d60302c89a17bbbe96241f22260c946d42c2c395a1ed823a1c6b8c32407bf7e
BLAKE2b-256 checksum
How to use checksums
22ba7d1a856587e5db004c194fceff41f26e303752122ce72bf258c6ba1bfa73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Release files / sawalign-0.1.1-py3-none-any.whl

Download URL sawalign-0.1.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e61090b238092ac001f3a71aa3c20edc5503e71f4ccddbdf35c68ec1c514cbfd
BLAKE2b-256 checksum
How to use checksums
e704e5399a67e5f6729282ff47cd2407dd4c8fbc1ac2d337fb2af7ab1861a055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Security for sawalign 0.1.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sawalign-0.1.1.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 Nov 14, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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