Open JTalk
# Open JTalk Test# python3# exec `apt install open-jtalk open-jtalk-mecab-naist-jdic`# get `mei_normal.htsvoice` from http://www.mmdagent.jp/import subprocessp = subprocess.Popen('open_jtalk -x /var/lib/mecab/dic/open-jtalk/naist-jdic -m mei/mei_normal.htsvoice -r 1.0 -ow /dev/stdout', stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)text = 'こんにちは'out, err = p.communicate(text.encode('utf-8'))print(text)print(err)# outにwavのバイナリが入ってる。必要に応じてここ変えてねwith open('b.wav', 'wb') as fp:fp.write(out)
- subprocess で shell=True でリストを与えたときの挙動 - Qiita
- 合成音声(Open Jtalk)でwavファイルを作成しないで再生する - Qiita
- python - input directly in process.communicate() in subprocess library - Stack Overflow
- subprocessについて調べたメモ - Qiita
- Debian Jessie に OpenJtalk を入れてテキストを読み上げてみた - 残しときます(自分用)
- 日本語音声合成Open JTalkをPythonから実行する - 動かざることバグの如し
- mmdagent.jp
- Open JTalk - HMM-based Text-to-Speech System
See also
- mpg123