{"id":6618,"library":"espeakng-loader","title":"eSpeak NG Loader","description":"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.","status":"active","version":"0.2.4","language":"en","source_language":"en","source_url":"https://github.com/thewh1teagle/espeakng-loader","tags":["eSpeak-NG","TTS","Text-to-Speech","speech synthesis","shared library","loader","cross-platform"],"install":[{"cmd":"pip install espeakng-loader","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This Python package is a *loader* for the eSpeak NG shared library, not the library itself. The eSpeak NG binaries and data must be installed separately on the operating system (Linux, Windows, macOS) for this package to function.","package":"eSpeak NG shared library","optional":false},{"reason":"Runtime requirement.","package":"Python >=3.6","optional":false},{"reason":"While not a direct Python dependency, the underlying eSpeak NG library often relies on `pcaudiolib` for audio output, especially on Linux. Issues with `pcaudiolib` can prevent sound generation.","package":"pcaudiolib (for eSpeak-NG audio output)","optional":true}],"imports":[{"symbol":"get_library_path","correct":"from espeakng_loader import get_library_path"},{"symbol":"load_library","correct":"from espeakng_loader import load_library"},{"symbol":"make_library_available","correct":"from espeakng_loader import make_library_available"}],"quickstart":{"code":"import os\nfrom espeakng_loader import get_library_path, load_library, make_library_available\n\ntry:\n    # Get the path to the loaded eSpeak NG shared library\n    library_path = get_library_path()\n    print(f\"eSpeak NG library path: {library_path}\")\n\n    # Example: Directly load the library (returns a ctypes.CDLL object)\n    # This is useful if you're writing a direct binding or need the CDLL object.\n    espeak_ng_cdll = load_library()\n    print(f\"eSpeak NG library loaded directly: {espeak_ng_cdll}\")\n    \n    # Example: Make the library available for other systems (e.g., via PATH on Windows/LD_LIBRARY_PATH on Linux)\n    # This is typically handled implicitly or by other Python bindings.\n    # make_library_available()\n    # print(\"eSpeak NG library made available to system.\")\n\n    # Note: To actually use eSpeak NG to speak text, you would typically\n    # use another Python package that provides bindings to the C library,\n    # like 'espeakng' (pip install espeakng).\n\nexcept RuntimeError as e:\n    print(f\"Error: {e}\")\n    print(\"Please ensure the eSpeak NG shared library is installed on your system.\")\n    print(\"On Ubuntu/Debian: sudo apt-get install espeak-ng\")\n    print(\"On Windows, download installer from https://github.com/espeak-ng/espeak-ng/releases\")\n","lang":"python","description":"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."},"warnings":[{"fix":"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.","message":"The `espeakng-loader` package *does not install* the eSpeak NG text-to-speech engine itself. Users *must* manually install the `espeak-ng` shared library and its data files on their operating system for this Python package to function. Failure to do so will result in `RuntimeError: espeak-ng library not found`.","severity":"breaking","affected_versions":"All versions"},{"fix":"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.","message":"The eSpeak NG library requires access to its data directory (e.g., containing `phontab` files). If `espeak-ng-data` is not found in a standard location, you might encounter errors like \"Error processing file '/usr/local/share/espeak-ng-data/phontab': No such file or directory\".","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install `phonemizer-fork` instead of `phonemizer` if you plan to use it with `espeakng-loader`.","message":"When integrating `espeakng-loader` with the `phonemizer` package, use `phonemizer-fork` instead of the official `phonemizer` package due to an unresolved issue (#191).","severity":"gotcha","affected_versions":"All versions up to 0.2.4 when used with `phonemizer`"},{"fix":"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.","message":"On Linux, audio output issues (e.g., no sound) can occur if the underlying `espeak-ng` library has problems with `pcaudiolib` or `pulseaudio`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}