「Open JTalk」は、名古屋工業大学の
徳田・李研究室で開発されているオープンソースの日本語音声合成エンジンで、2011/12/25 にバージョン 1.05がリリースされました。
「
takayanの雑記帳:Open JTalk の VC++2008 用ソリューションファイルを作ってみた。」の記事を頼りに、Windows上でコンパイルをし、オプション設定をいじってみました。
※2012/05/06 追記
takayan さんが、もっと簡単なインストール方法を紹介してくださっています。こちらを参照ください。
takayanの雑記帳:Open JTalk を Windows でビルドするバッチファイル
●音声サンプル
【サンプル文章】
市民の皆さんが安心して暮らせる「災害に強いまちづくり」を推進するため、次のとおり総合防災訓練を実施します。
男性:m001 (16kHz)

男性:m001 (48kHz)

女性:mei (16kHz)

女性:mei (48kHz)
●更新情報
・open_jtalk (ファイル NEWS より)
Version 1.05:
* modify pronunciation rule after a decimal point.
* modify accent type detection.
* add new moras and new words.
* fix some bugs.
Version 1.04:
* fix some bugs.
* modify dictionary.
・hts_engine_API (ファイル NEWS より)
Version 1.06:
* modify state duration calculation algorithm.
* change many function from void to boolean.
* change source format.
* bug fixes.
Version 1.05:
* support PortAudio for audio output.
●手順
(1)「
Visual C++ 2010 Express」をインストールする。
(2)「
7-zip」をインストールする。
(3)「
http://open-jtalk.sourceforge.net/」から、以下のファイルをダウンロードする。
open_jtalk-1.05.tar.gz
open_jtalk_dic_shift_jis-1.05.tar.gz
hts_voice_nitech_jp_atr503_m001-1.04.tar.gz
(4)「
http://hts-engine.sourceforge.net/」から、以下のファイルをダウンロードする。
hts_engine_API-1.06.tar.gz
(5)
takayanの雑記帳 から、以下のファイルをダウンロードする。
open_jtalk_v9_sln-1.01.zip
(6)これを解凍し、「expand.bat」 内の”set ver=1.00” などを編集してから、実行する。
(7)「open_jtalk.sln」をVC++で開き、mecabのソースの dictionary_rewriter.cpp 、viterbi.cpp の2つのファイルの先頭部分に
#include <iterator>
を追加する。(VC++2010の場合)
(8)コンパイルを実行する。
(9)「test.bat」を開き、オプションに”-s 48000 -z 6000 -p 240 -a 0.55 ^” を追加する。
(10)「test.bat」を実行すると、音声読み上げがされる。
●音声の追加
●オプション例
●オプション詳細
| オプション | 説明 | 省略時 | 範囲 |
|---|
| -s int | sampling frequency | | 16000 | [ 1--48000] |
| -z int | audio buffer size | | 1600 | [ 0--48000] |
| -p int | frame period (point) | 話速 | 80 | [ 1--] |
| -a float | all-pass constant | 声質 | 0.42 | [ 0.0--1.0] |
| -b float | postfiltering coefficient | | 0.0 | [-0.8--0.8] |
| -g int | gamma = -1 / i
(if i=0 then gamma=0) | | 0 | [ 0-- ] |
| -u float | voiced/unvoiced threshold | | 0.5 | [ 0.0--1.0] |
| -jm float | weight of GV for spectrum | 音量 | 1.0 | [ 0.0--2.0] |
| -jf float | weight of GV for Log F0 | 抑揚 | 1.0 | [ 0.0--2.0] |
| -jl float | weight of GV for low-pass filter | | 1.0 | [ 0.0--2.0] |
| -l | regard input as log gain and output linear one (LSP) |
| -x dir | dictionary directory |
| -td tree | decision trees file for state duration |
| -tm tree | decision trees file for spectrum |
| -tf tree | decision trees file for Log F0 |
| -tl tree | decision trees file for low-pass filter |
| -em tree | decision tree file for GV of spectrum |
| -ef tree | decision tree file for GV of Log F0 |
| -el tree | decision tree file for GV of low-pass filter |
| -k tree | use GV switch |
| -md pdf | model file for state duration |
| -mm pdf | model file for spectrum |
| -mf pdf | model file for Log F0 |
| -ml pdf | model file for low-pass filter |
| -cm pdf | filename of GV for spectrum |
| -cf pdf | filename of GV for Log F0 |
| -cl pdf | filename of GV for low-pass filter |
| -dm win | window files for calculation delta of spectrum |
| -df win | window files for calculation delta of Log F0 |
| -dl win | window files for calculation delta of low-pass filter |
| -ow string | filename of output wav audio (generated speech) |
| -ot string | filename of output trace information |
●不明な点
(1) -g オプションで、1以上の整数を指定すると、読み上げしません。バグなのだろうか、コンパイル時の warning を無視しているのが悪いのだろうか?
(2)読み上げ文の先頭に全角スペースがあると、"WARNING: JPCommonLabel_push_word() in jpcommon_label.c: First mora should not be short pause." というメッセージを吐く。
◆関連記事
◆関連サイト