styletts2-multi-kokoro-82m-espeak_misaki
A StyleTTS2 model by hexgrad, from hexgrad/Kokoro-82M, packaged for phoonnx, our ONNX text-to-speech library.
Model details
| 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 |
How to use
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"}}}
Text front end
phoonnx hands the text to scriptconv, our text conversion library, which normalises it and turns it into the model's input:
espeak:EspeakPhonemizerfromscriptconv_copyleft.phonemizers.mul, installed by thescriptconv[espeak]extra.misaki_en:MisakiEnPhonemizerfromscriptconv_copyleft.phonemizers.mul, installed by thescriptconv[misaki]extra.misaki_ja:MisakiJaPhonemizerfromscriptconv_copyleft.phonemizers.mul, installed by thescriptconv[misaki]extra.misaki_zh:MisakiZhPhonemizerfromscriptconv_copyleft.phonemizers.mul, installed by thescriptconv[misaki]extra.
phoonnx voices
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_yunyang
Licence
The upstream declares the licence apache-2.0 in the model card of hexgrad/Kokoro-82M.
Related projects
- phoonnx: runs this model, in Python and in OVOS.
- scriptconv: text normalisation, script conversion and phonemizers for phoonnx.
- The StyleTTS2 collection: every StyleTTS2 model packaged for phoonnx.