eSpeak NG Loader is a Python package (version 0.2.4, released January 16, 2025) designed to dynamically load the eSpeak NG shared library, making it available for other Python libraries or applications that require eSpeak NG functionality. It simplifies the process of interacting with the underlying C library, abstracting away platform-specific loading mechanisms. The project demonstrates an active release cadence with recent updates.
pip install espeakng-loaderVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to retrieve the path to the eSpeak NG shared library using `get_library_path()` and how to load it directly into your Python process with `load_library()`. It also includes guidance on the essential prerequisite of having the eSpeak NG library installed on the system.
Install `espeak-ng` system-wide. For Debian/Ubuntu, `sudo apt-get install espeak-ng`. For Windows, download and run the installer from the official eSpeak NG GitHub releases page (https://github.com/espeak-ng/espeak-ng/releases). For macOS, you might need to build from source or use a package manager like Homebrew.
Ensure the `espeak-ng-data` directory is in a location where the eSpeak NG library can find it. This might involve setting the `ESPEAK_DATA_PATH` environment variable to point to the correct directory or ensuring a proper system-wide installation.
Install `phonemizer-fork` instead of `phonemizer` if you plan to use it with `espeakng-loader`.
Ensure `libpulse-dev` is installed before compiling `espeak-ng` (if building from source), or troubleshoot `pulseaudio` configuration. Testing `espeak-ng` from the command line directly can help diagnose if the issue is with the Python loader or the underlying `espeak-ng` installation.
Install the `espeak-ng` development package system-wide (e.g., `sudo apt install espeak-ng` on Debian/Ubuntu, `brew install espeak-ng` on macOS) or ensure the directory containing `libespeak-ng.so.1` is in your `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) environment variable.
Install the correct 32-bit or 64-bit version of `espeak-ng` for your Windows system and ensure its installation directory (containing `libespeak-ng.dll`) is added to the system's PATH environment variable. Restart your terminal or IDE after modifying PATH.
Install the `espeak-ng` software system-wide (e.g., download the installer for Windows, use a package manager for Linux/macOS) and ensure its executable's directory is added to your operating system's PATH environment variable. Restart your command prompt or terminal.
Install the package using pip: `pip install espeakng-loader`.