StyleTTS2
Collection
StyleTTS2 models in ONNX for phoonnx, Kitten TTS included. โข 15 items โข Updated
A StyleTTS2 model by hexgrad, from hexgrad/Kokoro-82M, packaged for phoonnx, our ONNX text-to-speech library.
| Architecture | StyleTTS2 |
| Upstream | hexgrad/Kokoro-82M |
| ONNX conversion | onnx-community/Kokoro-82M-v1.0-ONNX |
| Author | hexgrad |
| Languages | en-GB, en-US, es, fr, hi, it, ja-JP, pt-BR, zh |
| Text input | espeak phonemes, IPA alphabet; misaki_en phonemes, IPA alphabet; misaki_ja phonemes, IPA alphabet; misaki_zh phonemes, IPA alphabet |
pip install --pre phoonnx "scriptconv[misaki]"
The phonemes come from the espeak-ng program, so install it too (for example
apt install espeak-ng). Without it, pip install --pre "phoonnx[espeak]" gives
phoonnx the espyak port of espeak-ng. Some espyak phonemes differ from those of
espeak-ng, so the voice can say some words wrong with espyak.
import wave
from phoonnx.model_manager import TTSModelManager
manager = TTSModelManager()
manager.load()
manager.merge_default_voices()
voice = manager.voices["kokoro/af"].load()
with wave.open("output.wav", "wb") as wav_file:
text = "..." # a sentence in en-US
voice.synthesize_wav(text, wav_file)
In OVOS, phoonnx installs the ovos-tts-plugin-phoonnx plugin. Select the voice in mycroft.conf:
{"tts": {"module": "ovos-tts-plugin-phoonnx", "ovos-tts-plugin-phoonnx": {"voice": "kokoro/af"}}}
phoonnx hands the text to scriptconv, our text conversion library, which normalises it and turns it into the model's input:
espeak: EspeakPhonemizer from scriptconv.phonemizers.mul, installed by the scriptconv[espeak] extra.misaki_en: MisakiEnPhonemizer from scriptconv.phonemizers.mul, installed by the scriptconv[misaki] extra.misaki_ja: MisakiJaPhonemizer from scriptconv.phonemizers.mul, installed by the scriptconv[misaki] extra.misaki_zh: MisakiZhPhonemizer from scriptconv.phonemizers.mul, installed by the scriptconv[misaki] extra.kokoro/afkokoro/af_alloykokoro/af_aoedekokoro/af_bellakokoro/af_heartkokoro/af_jessicakokoro/af_korekokoro/af_nicolekokoro/af_novakokoro/af_riverkokoro/af_sarahkokoro/af_skykokoro/am_adamkokoro/am_echokokoro/am_erickokoro/am_fenrirkokoro/am_liamkokoro/am_michaelkokoro/am_onyxkokoro/am_puckkokoro/am_santakokoro/bf_alicekokoro/bf_emmakokoro/bf_isabellakokoro/bf_lilykokoro/bm_danielkokoro/bm_fablekokoro/bm_georgekokoro/bm_lewiskokoro/ef_dorakokoro/em_alexkokoro/em_santakokoro/ff_siwiskokoro/hf_alphakokoro/hf_betakokoro/hm_omegakokoro/hm_psikokoro/if_sarakokoro/im_nicolakokoro/jf_alphakokoro/jf_gongitsunekokoro/jf_nezumikokoro/jf_tebukurokokoro/jm_kumokokoro/pf_dorakokoro/pm_alexkokoro/pm_santakokoro/zf_xiaobeikokoro/zf_xiaonikokoro/zf_xiaoxiaokokoro/zf_xiaoyikokoro/zm_yunjiankokoro/zm_yunxikokoro/zm_yunxiakokoro/zm_yunyangThe upstream declares the licence apache-2.0 in the model card of hexgrad/Kokoro-82M.