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

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.13
File Size Uploaded Provenance
praatfan_rust-0.1.13.tar.gz 120.7 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for praatfan-rust 0.1.13
File
praatfan_rust-0.1.13-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
praatfan_rust-0.1.13-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
praatfan_rust-0.1.13-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.13-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
praatfan_rust-0.1.13-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
praatfan_rust-0.1.13-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 9.8 MB

Release files / praatfan_rust-0.1.13.tar.gz

Download URL praatfan_rust-0.1.13.tar.gz
Size 120.7 kB
Tags Source
SHA-256 checksum
How to use checksums
713f046ceb799ade1aed2c935c65becd77ee877c15ef58f232ad7211875db7cc
BLAKE2b-256 checksum
How to use checksums
8e35c565326b201215149ab13fc8326828ab09056a1fd0cff7ad272aabf3db11
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.13-cp39-abi3-win_arm64.whl

Download URL praatfan_rust-0.1.13-cp39-abi3-win_arm64.whl
Size 1.3 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
b0a6c82c39f59d4ed421b260ef7d8033ea44a8336d0cba483e3c7c0ecab47807
BLAKE2b-256 checksum
How to use checksums
2d782875a532c852ebdf5215046c36081a139a0bec077d70280235d66dd16fd8
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.13-cp39-abi3-win_amd64.whl

Download URL praatfan_rust-0.1.13-cp39-abi3-win_amd64.whl
Size 1.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2a8c28728bc9fe12bb702d0f5a3fe66418f643a41fe132bbb3de7981d6d1ab7b
BLAKE2b-256 checksum
How to use checksums
a8de7dd36c78847a1c797c3e9294fbf00d81d24ec46d1f94ac77cb631e381bf3
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.13-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL praatfan_rust-0.1.13-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
b01c90a4640d8c9c82bc60fb3f3a1f6cb9a8bfb826f210ab7f07fc8aaecacd26
BLAKE2b-256 checksum
How to use checksums
d99392d38bf46668a37f6a74a80bf8dd9a8c490c4f68fbdf95ac38d9e03f3d37
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.13-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL praatfan_rust-0.1.13-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
f22df18cab7415865b2fa95b2bff97a0f61ba0d87201e112ac9e95973b58eba0
BLAKE2b-256 checksum
How to use checksums
8cb1dcb1217d1529b4cdd9d435f5666d3d4e124c53107f5c258be8bcd4068ad1
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.13-cp39-abi3-macosx_11_0_arm64.whl

Download URL praatfan_rust-0.1.13-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
9d672fd57c222f3be22061fa24ea2e8647ccef5492b3b43a2322d82598f4daf1
BLAKE2b-256 checksum
How to use checksums
298a673262b897f8c7a641c671597df39c62b53651cc18ec797ba543d340296e
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.13-cp39-abi3-macosx_10_12_x86_64.whl

Download URL praatfan_rust-0.1.13-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
704225f3ab3a1c666b4eed00d3f5f389833b40aefdf17c3bedf2152e3a69ebda
BLAKE2b-256 checksum
How to use checksums
32665d1232cae559b86f377fc246485113f6422f69169d3ad0b9e5f838735859
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.13

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