Registry / ai-ml / praat-parselmouth

praat-parselmouth

JSON →
library0.4.7pypypi✓ verified 87d ago

Parselmouth is a Python library that provides a Pythonic interface to Praat, a widely used program for phonetic analysis. It wraps Praat's C++ core, allowing direct access to its functionalities for speech processing, acoustic analysis, and manipulation. The current version is 0.4.7, with minor releases and bug fixes occurring frequently.

pip install praat-parselmouth
INSTALL
IMPORT
SIG · PRAAT-PARSELMOUTH
P
praat-parselmouth
ai-mlpythonv0.4.7
Install
4.1s avg
Import
295ms
Disk
122MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.1s · import 0.295s · 121MB
122MB installed
● package 122MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parselmouth
import parselmouth
Sound
import parselmouth sound = parselmouth.Sound(...)
praat
import parselmouth parselmouth.praat.call(...)

This example demonstrates how to create a simple sound object from a NumPy array, perform a common acoustic analysis (pitch extraction), and use `parselmouth.praat.call` for direct Praat commands.

import parselmouth import numpy as np # Create a dummy sound object (e.g., a sine wave) sr = 44100 # Sample rate duration = 1.0 # seconds t = np.linspace(0, duration, int(sr * duration), endpoint=False) frequency = 440.0 # Hz amplitude = 0.5 dummy_wave = amplitude * np.sin(2 * np.pi * frequency * t) # Load the sound into Parselmouth sound = parselmouth.Sound(dummy_wave, sr) # Perform a basic Praat operation: extract pitch pitch = sound.to_pitch() # Print some information print(f"Sound duration: {sound.duration:.2f} seconds") print(f"First pitch value (at 0.1s): {pitch.get_value_at_time(0.1):.2f} Hz") # Example of using a Praat command directly via parselmouth.praat.call intensity = parselmouth.praat.call(sound, "To Intensity", 100, 0, False) print(f"Mean intensity: {intensity.get_mean():.2f} dB")
Debug
Known issues
gotchaInstallation of `praat-parselmouth` can fail if a pre-built wheel is not available for your specific Python version and operating system, requiring compilation from source. This needs a C++ compiler (e.g., MSVC, GCC, Clang) and CMake to be installed and configured on your system.
fix
Ensure you have a C++ compiler and CMake installed. Check the official Parselmouth documentation for platform-specific build instructions. Installing `scikit-build-core` might also help: `pip install scikit-build-core`.
affects: <0.4.7
breakingVersions of Parselmouth prior to 0.4.4 had compatibility issues with NumPy 2.x, leading to errors when processing audio data or accessing array properties.
fix
Upgrade Parselmouth to version 0.4.4 or newer: `pip install --upgrade praat-parselmouth`.
affects: <0.4.4
gotchaIn older versions of Parselmouth (prior to 0.3.3), using `parselmouth.praat.call` or `parselmouth.praat.run` could lead to crashes when passing empty lists of objects or when returning objects that already existed in Praat's memory.
fix
Upgrade Parselmouth to version 0.3.3 or newer to avoid these specific crash scenarios: `pip install --upgrade praat-parselmouth`.
affects: <0.3.3
gotchaWhile Parselmouth aims for broad Python compatibility, explicit support for newer Python versions (e.g., 3.10, 3.11) was added in specific minor releases (v0.4.1, v0.4.2). Using an older Parselmouth version with the very latest Python releases might encounter unexpected issues.
fix
Always use the latest stable version of Parselmouth for optimal compatibility with recent Python interpreters: `pip install --upgrade praat-parselmouth`.
affects: <0.4.2
Errors
Common errors & fixes
ERROR: Failed building wheel for praat-parselmouth
A pre-built wheel for your specific operating system and Python version was not found, and the system lacks the necessary C++ compiler or build tools (like CMake) to compile Parselmouth from source.
fix
Install a C++ compiler (e.g., Visual Studio Build Tools on Windows, Xcode Command Line Tools on macOS, `build-essential` on Debian/Ubuntu, or `cmake` for all platforms) and try `pip install praat-parselmouth` again.
AttributeError: module 'numpy' has no attribute 'array_api'
This error typically occurs when using Parselmouth versions older than 0.4.4 with a NumPy 2.x installation, due to changes in NumPy's internal structure.
fix
Upgrade Parselmouth to version 0.4.4 or higher: `pip install --upgrade praat-parselmouth`.
ModuleNotFoundError: No module named 'parselmouth'
The `praat-parselmouth` library has not been installed, or the Python environment where it was installed is not currently active.
fix
Install the library using `pip install praat-parselmouth`. If using virtual environments, ensure the correct environment is activated before running your script.
TypeError: 'Sound' object is not callable
You are attempting to call a Parselmouth object (e.g., an instance of `Sound` or `Pitch`) as if it were a function, instead of using its methods or passing it to `parselmouth.praat.call()`.
fix
Review the Parselmouth documentation for the correct way to interact with objects. Use methods like `sound.to_pitch()` or pass objects to `parselmouth.praat.call(object, 'PraatCommand')`.
Upgrade
Version history
0.4.7latest on PyPI · released Nov 27, 2025
Audit
Dependencies
numpyrequiredRequired for array manipulation and data representation.
tgtoptionalOptional dependency for converting between Praat TextGrid objects and TextGridTools (tgt) library objects.
Agent activity
2 hits · last 30 days
node
2
Resources
praat-parselmouth — pip install praat-parselmouth · libregistry