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/Vorbis and ADTS AAC; not AIFF or CAF). 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. Since 0.1.14 results are also the same on every machine:
maths functions come from the pure-Rust libm crate and FFTs from a vendored
FFTPACK port, so nothing depends on the host's maths library or on CPU
features detected at run time. 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.
Links
- Source, documentation and issues: https://github.com/ucpresearch/praatfan-core-clean
- Pure-Python sibling: https://pypi.org/project/praatfan/
Licence
MIT. The wheel also contains third-party code (MIT, Apache-2.0, BSD, Zlib,
Unicode-3.0, and the MPL-2.0 symphonia decoders, unmodified); their notices
are in the wheel's LICENSE-THIRD-PARTY file.
Metadata
Release files for praatfan-rust 0.1.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| praatfan_rust-0.1.16.tar.gz | 168.8 kB | Without provenance | Details for praatfan_rust-0.1.16.tar.gz |
Built distributions (wheels)
Total release size: 8.4 MB
Release files / praatfan_rust-0.1.16.tar.gz
| Download URL | praatfan_rust-0.1.16.tar.gz |
|---|---|
| Size | 168.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87d0eb6a7dac16195951a7a93c93c25dc8fe26a27f7a178a4deb0f4d2273fccb
|
|
BLAKE2b-256 checksum How to use checksums |
ac06acc08e35642dc610b5cfe0f3be6458d867e8189783f3accfb115f6bd1aef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / praatfan_rust-0.1.16-cp39-abi3-win_arm64.whl
| Download URL | praatfan_rust-0.1.16-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
fecff277d5072844bb483c205ea190f9e40017fcc49b8b02478620639c0a9637
|
|
BLAKE2b-256 checksum How to use checksums |
cdebb6276fbab0a01a1ffbd72052edd98544b67b35d0835fe0b9e911a2086791
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / praatfan_rust-0.1.16-cp39-abi3-win_amd64.whl
| Download URL | praatfan_rust-0.1.16-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
462fd378686d66dea902d3080e772ad1fca09ffea9013278f13c1dceaf59bb88
|
|
BLAKE2b-256 checksum How to use checksums |
f6438e1864bf501efeb2619006776872bb81c5e51ceeddcde60010454b0f84d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / praatfan_rust-0.1.16-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | praatfan_rust-0.1.16-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c63d42a2187f5a3a3704cf81f810e60244d54fde0b9fa9fa9d960c3dfb7a30a8
|
|
BLAKE2b-256 checksum How to use checksums |
d14b4290e0568390e67e2ac097794df0f6cb67b9fee224001e8e1c802ebf9f62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / praatfan_rust-0.1.16-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | praatfan_rust-0.1.16-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f45088787fde2b3246ed7c67ed653296913416b96d414afd7a5f363dc8f02620
|
|
BLAKE2b-256 checksum How to use checksums |
c72bf508e8be693d50cf5def7fc0ee64d43a537643e7ed2e7fe075276aee8d0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / praatfan_rust-0.1.16-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | praatfan_rust-0.1.16-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f53d5d293b6d657d230c5927dd57b6070b917701e4a0cddd0668b593c4919356
|
|
BLAKE2b-256 checksum How to use checksums |
5e7ba2b26f32214a70b04b7641601ae224cddc58af96c28c8f75f3071efb7ea5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / praatfan_rust-0.1.16-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | praatfan_rust-0.1.16-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d898e052bf48688dd9f5ae9e6458c1a9d56eec4639ffe6014158511c42851273
|
|
BLAKE2b-256 checksum How to use checksums |
a5b700ff64ea4a200412451239ec497481420aa0ae677d5966794dea2bf2878c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Security for praatfan-rust 0.1.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.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.