Registry / ai-ml / pyopenjtalk-plus

pyopenjtalk-plus

JSON →
library0.4.1.post8pypypiunverified

pyopenjtalk-plus is a Python wrapper for OpenJTalk, a Japanese Text-to-Speech (TTS) system. It enhances the original pyopenjtalk with features like automatic dictionary and voice data downloads, customizable voice presets, and improved phoneme generation. The library is actively maintained, currently at version 0.4.1.post8, with frequent minor updates addressing bug fixes and improvements.

pip install pyopenjtalk-plus
INSTALL
IMPORT
SIG · PYOPENJTALK-PLUS
P
pyopenjtalk-plus
ai-mlpythonv0.4.1.post8
Install
8.2s avg
Import
Disk
427MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.1.post8 · 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
glibc
py 3.10
✕ build_error
✓ 8s
py 3.11
✕ build_error
✓ 9.1s
py 3.12
✕ build_error
✓ 7.05s
py 3.13
✕ build_error
✓ 8.5s
py 3.9
✕ build_error
1/2 runs
427MB installed
● package 427MB
Code
Verified usage

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

pyopenjtalk_plus
import pyopenjtalk_plus
make_phoneme
from pyopenjtalk_plus import make_phoneme
make_audio
from pyopenjtalk_plus import make_audio

This quickstart demonstrates how to generate phonemes and audio from Japanese text using pyopenjtalk-plus. The library automatically handles the download of OpenJTalk dictionaries and voice data on first use, simplifying setup. Audio output is a NumPy array, requiring external libraries like `soundfile` or `pyaudio` for saving or playback.

import pyopenjtalk_plus import os # Set a dummy variable for demonstration if needed, otherwise rely on default behavior. # pyopenjtalk-plus typically manages data download automatically. # os.environ['OPENJTALK_DATA_DIR'] = '/path/to/openjtalk_data' # Optional, for custom data path text = "こんにちは、世界。私はAIです。" # 1. Get phonemes phonemes = pyopenjtalk_plus.make_phoneme(text) print(f"Phonemes: {phonemes}") # 2. Generate audio (returns sample rate and numpy array of audio data) # The library will attempt to download necessary dictionaries and voice data on first run. try: sr, y = pyopenjtalk_plus.make_audio(text) print(f"Audio generated successfully: Sample Rate={sr}, Data shape={y.shape}") # To save the audio to a file, you'd typically use a library like soundfile: # import soundfile as sf # sf.write("output.wav", y, sr) # print("Audio saved to output.wav") except Exception as e: print(f"Error generating audio: {e}") print("Ensure OpenJTalk dictionaries and voice files are accessible. \n"\ "The library usually downloads them automatically, but network or permissions issues can cause failures.")
Debug
Known issues
gotchapyopenjtalk-plus relies on native OpenJTalk binaries and data (dictionaries, voice files). While the library attempts automatic downloads, network issues, firewall restrictions, or insufficient write permissions in the default data directory can cause failures. This often manifests as 'No such file or directory' errors for `.dic` or `.htsvoice` files.
fix
Ensure stable internet connection and write permissions. If automatic download fails, you may need to manually download and specify the `OPENJTALK_DATA_DIR` environment variable or `data_dir` parameter in function calls.
affects: All versions
gotchaFor optimal phoneme generation accuracy, particularly with complex or ambiguous Japanese text, it's highly recommended to install `python-mecab-t5m` (or `mecab-python3`). Without it, the library falls back to a less sophisticated internal MeCab implementation, which might produce less accurate phoneme sequences.
fix
Install the recommended MeCab binding: `pip install python-mecab-t5m`.
affects: All versions
gotchaThe `make_audio` function returns raw audio data as a NumPy array. It does not automatically play the sound or save it to a file. Users need to integrate additional libraries for these functionalities.
fix
To play audio, use `pyaudio` (e.g., `pip install pyaudio`). To save to a file (like WAV), use `soundfile` (e.g., `pip install soundfile`). Refer to their respective documentation for usage.
affects: All versions
gotchaOn some systems (especially Windows), the underlying `pyopenjtalk` dependency might require specific Visual C++ Redistributables or other native build tools if pre-compiled wheels are not available for your Python version/architecture. This can lead to `ImportError: DLL load failed` or compilation errors during installation.
fix
Ensure your system has the necessary build tools (e.g., 'Build Tools for Visual Studio' on Windows). Check the `pyopenjtalk` documentation for specific native dependencies.
affects: All versions
Upgrade
Version history
0.4.1.post8latest on PyPI · released Mar 30, 2026
Audit
Dependencies
pyopenjtalkrequiredCore dependency for OpenJTalk functionality
numpyrequiredRequired for handling audio data (NumPy arrays)
requestsrequiredUsed for downloading dictionaries and voice data
tqdmrequiredProvides progress bars for downloads
python-mecab-t5moptionalOptional, recommended for more accurate phoneme generation
soundfileoptionalOptional, for saving generated audio to files (e.g., WAV)
pyaudiooptionalOptional, for playing generated audio directly
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pyopenjtalk-plus — pip install pyopenjtalk-plus · libregistry