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

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.14

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.14
File Size Uploaded Provenance Actions
praatfan_rust-0.1.14.tar.gz 167.0 kB Without provenance Details for praatfan_rust-0.1.14.tar.gz

Built distributions (wheels)

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

Total release size: 8.3 MB

Release files / praatfan_rust-0.1.14.tar.gz

Download URL praatfan_rust-0.1.14.tar.gz
Size 167.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e5097c10ebcfbc53574adbb7f513f47e98196b759a7c7e00388b650f6179b26c
BLAKE2b-256 checksum
How to use checksums
cfdeb0fd65cd8719abda60780d4f777a98373b33d5c0e9299dc2bd6e417cd638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

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

Download URL praatfan_rust-0.1.14-cp39-abi3-win_arm64.whl
Size 1.1 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
2d3ab2b99fab489ac466fca40d1fbc31d267fecc6db0fba7c49764515082bbcf
BLAKE2b-256 checksum
How to use checksums
9c92fe02fcce24bd2b342efac79d3d1c012e4a8d90c8681deea8fb8e635320e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

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

Download URL praatfan_rust-0.1.14-cp39-abi3-win_amd64.whl
Size 1.5 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e1fd15f8af5a364e159df1bae35ba01af73a031e3382a2ac698a404740995559
BLAKE2b-256 checksum
How to use checksums
084bb9ad3eee43e82ae2167f45f30aaf1e0cc1c7ea4a9f3e5b956529453cf340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

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

Download URL praatfan_rust-0.1.14-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
5a2bb47671febe57dd02920524d797a4ffa7eae7a9bbf28b3d8a65995b749d89
BLAKE2b-256 checksum
How to use checksums
949837b46c4613d30ba2bee7c524df36c3b8b3e8ca05734e85678291251cc049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

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

Download URL praatfan_rust-0.1.14-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
a49561bf1e8cf8917eafa52df34f3134cf75bb32ef0f8af277326c8ae3aafdd7
BLAKE2b-256 checksum
How to use checksums
7881ed0417522d80b3e7341d32dc44f15680a544ead23907d9b99b59c369ada3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

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

Download URL praatfan_rust-0.1.14-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
a1dbf23e05b25f04ce6fa075d36142b9a9ea4cd7856a2cf22bea8bf306781808
BLAKE2b-256 checksum
How to use checksums
357c8750657e1a654471383c763ebb8870eb6039eb623f884dc52cf430786996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

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

Download URL praatfan_rust-0.1.14-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
ed505d49716ab0574d501d47cc91fa571fff9e12fe983f9b416a8e95a811b0e1
BLAKE2b-256 checksum
How to use checksums
f917c668599e79a388266df4b56bdba7280d793b7ae65e8a4e8ba886f833eafb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for praatfan-rust 0.1.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.

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.

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