{"library":"pyopenjtalk-plus","title":"pyopenjtalk-plus","description":"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.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install pyopenjtalk-plus"],"cli":null},"imports":["import pyopenjtalk_plus","from pyopenjtalk_plus import make_phoneme","from pyopenjtalk_plus import make_audio"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pyopenjtalk_plus\nimport os\n\n# Set a dummy variable for demonstration if needed, otherwise rely on default behavior.\n# pyopenjtalk-plus typically manages data download automatically.\n# os.environ['OPENJTALK_DATA_DIR'] = '/path/to/openjtalk_data' # Optional, for custom data path\n\ntext = \"こんにちは、世界。私はAIです。\"\n\n# 1. Get phonemes\nphonemes = pyopenjtalk_plus.make_phoneme(text)\nprint(f\"Phonemes: {phonemes}\")\n\n# 2. Generate audio (returns sample rate and numpy array of audio data)\n# The library will attempt to download necessary dictionaries and voice data on first run.\ntry:\n    sr, y = pyopenjtalk_plus.make_audio(text)\n    print(f\"Audio generated successfully: Sample Rate={sr}, Data shape={y.shape}\")\n\n    # To save the audio to a file, you'd typically use a library like soundfile:\n    # import soundfile as sf\n    # sf.write(\"output.wav\", y, sr)\n    # print(\"Audio saved to output.wav\")\n\nexcept Exception as e:\n    print(f\"Error generating audio: {e}\")\n    print(\"Ensure OpenJTalk dictionaries and voice files are accessible. \\n\"\\\n          \"The library usually downloads them automatically, but network or permissions issues can cause failures.\")","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}