Skip to main content

praatfan-rust

Fast Rust implementation of Praat's core acoustic analysis algorithms, with Python bindings. MIT-licensed.

praatfan_rust is the compiled backend for praatfan — a clean-room reimplementation of Praat's acoustic analysis, written from published papers and Praat's public documentation rather than from Praat's GPL source, so it can be used under a permissive licence.

pip install praatfan-rust

It can be used directly, or installed alongside praatfan and selected automatically through that package's unified API.

What it computes

Analysis Methods
Pitch (F0) autocorrelation, cross-correlation
Formants Burg LPC, single and batched over ceilings
Intensity —
Harmonicity (HNR) autocorrelation, cross-correlation
Spectrum FFT, plus centre of gravity / spread / skewness / kurtosis
Spectrogram STFT

Audio is read via Symphonia (WAV, FLAC, MP3, OGG, AIFF, CAF and more). NIST SPHERE, including shorten-compressed, decodes through a statically linked desphere — no extra dependency and no external binary. Mono only; multi-channel files require an explicit channel selection.

Example

import praatfan_rust

sound = praatfan_rust.Sound("audio.wav")

pitch = sound.to_pitch_ac(time_step=0.01, pitch_floor=75.0, pitch_ceiling=600.0)
formant = sound.to_formant_burg(time_step=0.0, max_number_of_formants=5,
                                maximum_formant=5500.0)
harmonicity = sound.to_harmonicity_ac(0.01, 75.0, 0.1, 4.5)

Threading

Per-frame analysis (pitch, harmonicity, intensity, formants, spectrogram) and the resampler run on all CPU cores, with results bit-identical to a single-threaded run. Set RAYON_NUM_THREADS before the first analysis to limit the thread count, e.g. 1 when you already parallelise across processes. The GIL is released during analyses, and the library is safe to use in multiprocessing children started with fork. The WebAssembly build is single-threaded.

Reading harmonicity values

Two entries in an HNR contour are markers rather than measurements:

  • -200 — no periodicity was found (silence, DC, unvoiced).
  • NaN — the correlation is not resolvable from 1, so no HNR can be derived.

Filter both before averaging, e.g. v[np.isfinite(v) & (v > -200)]. The autocorrelation method also requires periods_per_window >= 3.0; below that the estimator is ill-conditioned and emits a FutureWarning (this will become an error in a future release). 4.5 is the standard value for the AC method; 1.0 is the CC default, not an AC one.

Also available

  • WebAssembly — the same core runs in the browser via wasm-pack.
  • praatfan-open-pipe — a JSON-over-stdin/stdout binary used by the R package, so R and shell callers pay the audio load once per file.

Licence

MIT.

Metadata

Release files for praatfan-rust 0.1.11

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

Source distribution (sdist)

Source distribution for praatfan-rust 0.1.11
File Size Uploaded Provenance
praatfan_rust-0.1.11.tar.gz 108.7 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for praatfan-rust 0.1.11
File
praatfan_rust-0.1.11-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
praatfan_rust-0.1.11-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
praatfan_rust-0.1.11-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
praatfan_rust-0.1.11-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
praatfan_rust-0.1.11-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
praatfan_rust-0.1.11-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 9.7 MB

Release files / praatfan_rust-0.1.11.tar.gz

Download URL praatfan_rust-0.1.11.tar.gz
Size 108.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a2e7ebf4368189123002b24e5885a64fa1f5acab7cf0b538d32500b3cb13dd2c
BLAKE2b-256 checksum
How to use checksums
3546a7b0c216132c0cf311771da8f30a665fadd45f8a5386ffd1d35c857ba7a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / praatfan_rust-0.1.11-cp39-abi3-win_arm64.whl

Download URL praatfan_rust-0.1.11-cp39-abi3-win_arm64.whl
Size 1.3 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
6cdb9527d87c7b759ed112e11c72c24114a9c9ff4151cbd3a76a6758d7b01acb
BLAKE2b-256 checksum
How to use checksums
56fc15d3b691a92d5faefec0f653e512a488ec6f1fa38fbe3fc420c89d4434b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / praatfan_rust-0.1.11-cp39-abi3-win_amd64.whl

Download URL praatfan_rust-0.1.11-cp39-abi3-win_amd64.whl
Size 1.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1e6ddc78e6f791b732ac66becff8f3b60c9251dabb2384c70a7a9b5136b21c0a
BLAKE2b-256 checksum
How to use checksums
d9ec46ca38e3109d2de91b3a0d6a94aecaaa57febb97d2de497fb954f7c5a1b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / praatfan_rust-0.1.11-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL praatfan_rust-0.1.11-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
856611e11cb9d4dca08f336211ce9ea8f6a910d82b5a8c618fe00f28069becba
BLAKE2b-256 checksum
How to use checksums
385968469a053c00d84bff549e9d477ae7dc4fa5388660c4dea598ffae7bc5a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / praatfan_rust-0.1.11-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL praatfan_rust-0.1.11-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
13a973be210de1c6386774331ddc978c394e754013009e16368fb42b3dbc8a30
BLAKE2b-256 checksum
How to use checksums
8796ee77c58169dbc4a8e97b2256eb3e9ae40b635ef206aa7f5d07126c1e0f70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / praatfan_rust-0.1.11-cp39-abi3-macosx_11_0_arm64.whl

Download URL praatfan_rust-0.1.11-cp39-abi3-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e67bf59c34ed065c8d7ecdc001dcf284a88e70af5846c5c73252f36d4fd84ee2
BLAKE2b-256 checksum
How to use checksums
051bee3aed55d92c0eec7340a5472906535b4e4aded5fd8ab8438b5f7181fcfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / praatfan_rust-0.1.11-cp39-abi3-macosx_10_12_x86_64.whl

Download URL praatfan_rust-0.1.11-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
50792e6224c83591993662cc14d28514e6b2efb30a33aa279b4676e58a38af58
BLAKE2b-256 checksum
How to use checksums
3570e406dd07472a9709f54a104f585827ba1fae51722d434278817b2ab34cd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for praatfan-rust 0.1.11

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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