やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

音声合成OpenJTalkをインストールする(ボイス70種)

 しゃべるラズパイ。 

成果物

 「こんにちは。音声合成OpenJTalkを使ったテストです。喋るラズベリーパイをご堪能あれ」

音響モデル 再生
ワタシ
緋惺
想音いくる
桃音モモ
闇夜 桜_1.0
戯歌ラカン
カマ声ギル子_1.0
民音ソウ
白狐舞
なないろニジ
松尾P
遠藤愛
沙音ほむ
遊音一莉
和音シバ
蒼歌ネロ
京歌カオル
想音いくと
天月りよん
獣音ロウ
スランキ
空唄カナタ
薪宮風季
20代男性01
誠音コト
飴音わめあ
唱地ヨエ
瑞歌ミズキ_Talk
グリマルキン_1.0
月音ラミ_1.0
句音コノ。
type-T
type-G
type-A
type-beta
type-B
type-alpha
cmu_us_arctic_slt
mei_happy
mei_bashful
mei_angry
mei_sad
mei_normal
takumi_normal
takumi_angry
takumi_happy
takumi_sad
tohoku-f01-angry
tohoku-f01-neutral
tohoku-f01-sad
tohoku-f01-happy
ひめる3
ぴよちゃんぼいす(
雪音ルウ
M
R
海賊まさver4
L
j2
H-09
H-02
J
ひめる
H-01
海賊まさver5
雪音ルウ2
海賊まさver2
風音桜凪
H-08
nitech_jp_atr503_m001

 残念ながら4つほどボイスデータが読込エラーになってしまった。

Error: Dictionary or HTS voice cannot be loaded.
  • cmu_us_arctic_slt.htsvoice
  • H-09.htsvoice
  • 海賊まさver5.htsvoice
  • 雪音ルウ2.htsvoice

 わかりにくいがtype-*初音ミク

情報源

 製作者さま方に超感謝。

手順

  1. ビルド&インストール
    1. HTS Engine
    2. Open JTalk
    3. ボイス
  2. 動作確認

1. ビルド&インストール

  1. HTS Engine
  2. Open JTalk
  3. ボイス

1-1. HTS Engine

 ダウンロード。

wget https://jaist.dl.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.10/hts_engine_API-1.10.tar.gz
wget https://master.dl.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.10/hts_engine_API_readme-1.10.txt
wget https://jaist.dl.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.10/hts_engine_API_reference-1.10.pdf

githubのは足りなかった。

git clone https://github.com/GSiSY/HTS_Engine

 /.configureがなかった。

 展開&移動。

tar -zxvf hts_engine_API-1.10.tar.gz
cd hts_engine_API-1.10

コンパイルオプション確認。

$ ./configure --help
`configure' configures hts_engine_API 1.10 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/hts_engine_API]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --enable-embedded   turn on compiling for embedded devices (default=no)
  --enable-festival   use memory allocation/free functions of speech tools (default=no)

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <hts-engine-users@lists.sourceforge.net>.

./configure

ログ

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for ar... ar
checking for log in -lm... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for vprintf... yes
checking for _doprnt... no
checking for sqrt... yes
checking for strchr... yes
checking for strrchr... yes
checking for strstr... yes
checking whether to enable compiling for embedded devices... no
checking whether to use memory allocation/free functions of speech tools... no
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking whether byte ordering is bigendian... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating bin/Makefile
config.status: creating lib/Makefile
config.status: executing depfiles commands

make
sudo make install
cd ..

1-2. Open JTalk

wget https://jaist.dl.sourceforge.net/project/open-jtalk/Open%20JTalk/open_jtalk-1.11/open_jtalk-1.11.tar.gz
wget https://excellmedia.dl.sourceforge.net/project/open-jtalk/Open%20JTalk/open_jtalk-1.11/open_jtalk_readme-1.11.txt
tar -zxvf open_jtalk-1.11.tar.gz
cd open_jtalk-1.11

 コンパイルオプション確認。

$ ./configure --help

ログ

`configure' configures open_jtalk 1.11 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/open_jtalk]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-hts-engine-header-path
                          specify the hts_engine_API header path
  --with-hts-engine-library-path
                          specify the hts_engine_API library path
  --with-charset          specify charset (EUC-JP/SHIFT_JIS/UTF-8)

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CPP         C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <open-jtalk-users@lists.sourceforge.net>.

./configure --with-hts-engine-header-path=/usr/local/include --with-hts-engine-library-path=/usr/local/lib --with-charset=UTF-8

ログ

lib --with-charset=UTF-8
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for ar... ar
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking for log in -lm... yes
checking for main in -lstdc++... yes
checking for iconv_open in -liconv... no
checking for iconv_open... yes
checking for ANSI C header files... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for sys/stat.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for sys/types.h... (cached) yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking for sys/types.h... (cached) yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking setjmp.h usability... yes
checking setjmp.h presence... yes
checking for setjmp.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for sqrt... yes
checking for strstr... yes
checking for getenv... yes
checking for opendir... yes
checking for setjmp... yes
checking whether gcc needs -traditional... no
checking whether make sets $(MAKE)... (cached) yes
checking for library containing strerror... none required
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for off_t... yes
checking for size_t... (cached) yes
checking size of char... 1
checking size of short... 2
checking size of int... 4
checking size of long... 4
checking size of long long... 8
checking size of size_t... 4
checking for size_t... (cached) yes
checking whether make is GNU Make... yes
checking if g++ supports template <class T> (required)... yes
checking if g++ supports const_cast<> (required)... yes
checking if g++ supports static_cast<> (required)... yes
checking if g++ supports dynamic_cast<> (required)... yes
checking if g++ supports reinterpret_cast<> (required)... yes
checking if g++ supports exception handler (required)... yes
checking if g++ supports namespaces (required) ... yes
checking if g++ environment provides all required features... yes
checking for HTS_engine.h... /usr/local/include/HTS_engine.h
checking for libHTSEngine.a... /usr/local/lib/libHTSEngine.a
checking charset... UTF-8
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating bin/Makefile
config.status: creating text2mecab/Makefile
config.status: creating mecab/Makefile
config.status: creating mecab/src/Makefile
config.status: creating mecab2njd/Makefile
config.status: creating njd/Makefile
config.status: creating njd_set_pronunciation/Makefile
config.status: creating njd_set_digit/Makefile
config.status: creating njd_set_accent_phrase/Makefile
config.status: creating njd_set_accent_type/Makefile
config.status: creating njd_set_unvoiced_vowel/Makefile
config.status: creating njd_set_long_vowel/Makefile
config.status: creating njd2jpcommon/Makefile
config.status: creating jpcommon/Makefile
config.status: creating mecab-naist-jdic/Makefile
config.status: creating mecab/config.h
config.status: executing depfiles commands

make
sudo make install
which open_jtalk

1-3. ボイス

1-3-1. HTS_Voice

wget https://jaist.dl.sourceforge.net/project/open-jtalk/HTS%20voice/hts_voice_nitech_jp_atr503_m001-1.05/hts_voice_nitech_jp_atr503_m001-1.05.tar.gz
wget https://master.dl.sourceforge.net/project/open-jtalk/HTS%20voice/hts_voice_nitech_jp_atr503_m001-1.05/hts_voice_nitech_jp_atr503_m001_readme-1.05.txt
tar -zxvf hts_voice_nitech_jp_atr503_m001-1.05.tar.gz
find hts_voice_nitech_jp_atr503_m001-1.05/ -name *.htsvoice

 ボイスファイルは以下。

hts_voice_nitech_jp_atr503_m001-1.05/nitech_jp_atr503_m001.htsvoice

1-3-2. MMDAgent

wget https://jaist.dl.sourceforge.net/project/mmdagent/MMDAgent_Example/MMDAgent_Example-1.8/MMDAgent_Example-1.8.zip
wget https://jaist.dl.sourceforge.net/project/mmdagent/MMDAgent_Example/MMDAgent_Example-1.8/MMDAgent_Example-1.8.mmda
wget https://svwh.dl.sourceforge.net/project/mmdagent/MMDAgent_Example/MMDAgent_Example-1.8/MMDAgent_Example_readme-1.8.txt
unzip MMDAgent_Example-1.8.zip
find MMDAgent_Example-1.8/ -name *.htsvoice

 ボイスファイルは以下。

MMDAgent_Example-1.8/Voice/takumi/takumi_sad.htsvoice
MMDAgent_Example-1.8/Voice/takumi/takumi_normal.htsvoice
MMDAgent_Example-1.8/Voice/takumi/takumi_happy.htsvoice
MMDAgent_Example-1.8/Voice/takumi/takumi_angry.htsvoice
MMDAgent_Example-1.8/Voice/slt/cmu_us_arctic_slt.htsvoice
MMDAgent_Example-1.8/Voice/mei/mei_sad.htsvoice
MMDAgent_Example-1.8/Voice/mei/mei_normal.htsvoice
MMDAgent_Example-1.8/Voice/mei/mei_happy.htsvoice
MMDAgent_Example-1.8/Voice/mei/mei_bashful.htsvoice
MMDAgent_Example-1.8/Voice/mei/mei_angry.htsvoice

1-3-3. akihiro0105.web.fc2.com

 上記サイトから任意のhtsvoiceファイルをダウンロードする。

wget https://www.dropbox.com/s/lhjwmh6tosmv7tm/%E6%83%B3%E9%9F%B3%E3%81%84%E3%81%8F%E3%82%8B_1.0.zip?dl=1
wget https://www.dropbox.com/s/5yrh8j4gaqmbn89/%E6%83%B3%E9%9F%B3%E3%81%84%E3%81%8F%E3%81%A8_1.0.zip?dl=1
wget https://www.dropbox.com/s/x1f7bldwjrmzton/%E4%BA%AC%E6%AD%8C%E3%82%AB%E3%82%AA%E3%83%AB_1.0.zip?dl=1
wget https://www.dropbox.com/s/qy24nlfwqhbtzvd/%E6%B2%99%E9%9F%B3%E3%81%BB%E3%82%80_1.0.zip?dl=1
wget https://www.dropbox.com/s/vsrsxx0h368ru2m/20%E4%BB%A3%E7%94%B7%E6%80%A701_1.0.zip?dl=1
wget https://www.dropbox.com/s/rb4t4x1p8x7182r/%E3%81%AA%E3%81%AA%E3%81%84%E3%82%8D%E3%83%8B%E3%82%B8_1.0.zip?dl=1
wget https://www.dropbox.com/s/aibhqzakxv6a7iw/%E9%81%A0%E8%97%A4%E6%84%9B_1.0.zip?dl=1
wget https://www.dropbox.com/s/0afvd64suh51e9g/%E9%81%8A%E9%9F%B3%E4%B8%80%E8%8E%89_1.0.zip?dl=1
wget https://www.dropbox.com/s/letu9qbtspuqa68/%E3%82%B9%E3%83%A9%E3%83%B3%E3%82%AD_1.0.zip?dl=1
wget https://www.dropbox.com/s/1q7ayg05bv8c95x/%E8%92%BC%E6%AD%8C%E3%83%8D%E3%83%AD_1.0.zip?dl=1
wget https://www.dropbox.com/s/fbr6wcaoaj6gfs5/%E7%B7%8B%E6%83%BA_1.0.zip?dl=1
wget https://www.dropbox.com/s/cqfuwsns0kveo75/%E5%A4%A9%E6%9C%88%E3%82%8A%E3%82%88%E3%82%93_1.0.zip?dl=1
wget https://www.dropbox.com/s/o6vd5d43spnqiqw/%E5%8F%A5%E9%9F%B3%E3%82%B3%E3%83%8E%E3%80%82_1.0.zip?dl=1
wget https://www.dropbox.com/s/1oqbtc4mqo76r7d/%E5%94%B1%E5%9C%B0%E3%83%A8%E3%82%A8_1.0.zip?dl=1
wget https://www.dropbox.com/s/ueivoklj4w5alec/%E3%82%AB%E3%83%9E%E5%A3%B0%E3%82%AE%E3%83%AB%E5%AD%90_1.0.zip?dl=1
wget https://www.dropbox.com/s/dhhxe5ax8gq9wf7/%E3%83%AF%E3%82%BF%E3%82%B7_1.0.zip?dl=1
wget https://www.dropbox.com/s/0a9sdvdc97y8cjy/%E9%A3%B4%E9%9F%B3%E3%82%8F%E3%82%81%E3%81%82_1.0.zip?dl=1
wget https://www.dropbox.com/s/wzg3elfzpj3r1nn/%E8%83%BD%E6%B0%91%E9%9F%B3%E3%82%BD%E3%82%A6_1.0.zip?dl=1
wget https://www.dropbox.com/s/565p1ezszoukfy7/%E7%A9%BA%E5%94%84%E3%82%AB%E3%83%8A%E3%82%BF_1.0.zip?dl=1
wget https://www.dropbox.com/s/divfct7u7deilpa/%E6%88%AF%E6%AD%8C%E3%83%A9%E3%82%AB%E3%83%B3_1.0.zip?dl=1
wget https://www.dropbox.com/s/biaaofnmd9idit1/%E8%AA%A0%E9%9F%B3%E3%82%B3%E3%83%88_1.0.zip?dl=1
wget https://www.dropbox.com/s/9ecqymm6jccgldk/%E7%99%BD%E7%8B%90%E8%88%9E_1.0.zip?dl=1
wget https://www.dropbox.com/s/ji63elmcjk60esf/%E6%9D%BE%E5%B0%BEP_1.0.zip?dl=1
wget https://www.dropbox.com/s/r9upv0z7wa8psb6/%E7%91%9E%E6%AD%8C%E3%83%9F%E3%82%BA%E3%82%AD_Talk_1.0.zip?dl=1
wget https://www.dropbox.com/s/9ocd1o0a8adabuy/%E8%96%AA%E5%AE%AE%E9%A2%A8%E5%AD%A3_1.0.zip?dl=1
wget https://www.dropbox.com/s/4bawa2afl4hqzu4/%E5%92%8C%E9%9F%B3%E3%82%B7%E3%83%90_1.0.zip?dl=1
wget https://www.dropbox.com/s/sny6b16eeeayee3/%E3%82%B0%E3%83%AA%E3%83%9E%E3%83%AB%E3%82%AD%E3%83%B3_1.0.zip?dl=1
wget https://www.dropbox.com/s/7ut7pfmjoaqdaj3/%E9%97%87%E5%A4%9C%20%E6%A1%9C_1.0.zip?dl=1
wget https://www.dropbox.com/s/vf4je8a4y2v1znz/%E6%9C%88%E9%9F%B3%E3%83%A9%E3%83%9F_1.0.zip?dl=1
wget https://www.dropbox.com/s/t96gik07qrn2oes/%E6%A1%83%E9%9F%B3%E3%83%A2%E3%83%A2_1.0.zip?dl=1
wget https://www.dropbox.com/s/elt5kbgbzeaksls/%E7%8D%A3%E9%9F%B3%E3%83%AD%E3%82%A6_1.0.zip?dl=1

 いくつか文字化けするので対策用アーカイバをインストールする。

sudo apt -y install unar
unar 獣音ロウ_1.0.zip
unar 桃音モモ_1.0.zip
unar "闇夜 桜_1.0.zip"
unar 月音ラミ_1.0.zip
unar グリマルキン_1.0.zip
unar 薪宮風季_1.0.zip
unar 和音シバ_1.0.zip
unar 瑞歌ミズキ_Talk_1.0.zip
unar 松尾P_1.0.zip
unar 白狐舞_1.0.zip
unar 誠音コト_1.0.zip
unar 戯歌ラカン_1.0.zip
unar 空唄カナタ_1.0.zip
unar 飴音わめあ_1.0.zip
unar 能民音ソウ_1.0.zip
unar カマ声ギル子_1.0.zip
unar ワタシ_1.0.zip
unar 句音コノ。_1.0.zip
unar 唱地ヨエ_1.0.zip
unar 天月りよん_1.0.zip
unar 緋惺_1.0.zip
unar スランキ_1.0.zip
unar 蒼歌ネロ_1.0.zip
unar 遊音一莉_1.0.zip
unar 遠藤愛_1.0.zip
unar 20代男性01_1.0.zip
unar なないろニジ_1.0.zip
unar 沙音ほむ_1.0.zip
unar 京歌カオル_1.0.zip
unar 想音いくと_1.0.zip
unar 想音いくる_1.0.zip

1-3-4. 配置

 一式を配置する。

sudo mkdir -p $HOME/root/sys/env/tool/openjtalk/voice/
cp ./hts_voice_nitech_jp_atr503_m001-1.05/ $HOME/root/sys/env/tool/openjtalk/voice/
cp ./MMDAgent_Example-1.8/ $HOME/root/sys/env/tool/openjtalk/voice/
cp 沙音ほむ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp なないろニジ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 20代男性01_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 蒼歌ネロ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 天月りよん_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 唱地ヨエ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 句音コノ。_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 和音シバ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 薪宮風季_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp グリマルキン_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 瑞歌ミズキ_Talk_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 松尾P_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 誠音コト_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 戯歌ラカン_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 空唄カナタ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp ワタシ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp スランキ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 遊音一莉_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 遠藤愛_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 京歌カオル_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 想音いくと_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 想音いくる_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 桃音モモ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/
cp 獣音ロウ_1.0 $HOME/root/sys/env/tool/openjtalk/voice/

 以下で探す。

find $HOME/root/sys/env/tool/openjtalk/voice/ -name *.htsvoice

2. 動作確認

 再生させる。

echo 'こんにちは' | open_jtalk \
 -x /usr/local/dic \
 -m /home/pi/root/sys/env/tool/openjtalk/voice/hts_voice_nitech_jp_atr503_m001-1.05/nitech_jp_atr503_m001.htsvoice \
 -ow /dev/stdout \
 | aplay > /dev/null 2>&1

 ボイスを変えてみる。

echo 'こんにちは' | open_jtalk \
 -x /usr/local/dic \
 -m /home/pi/root/sys/env/tool/openjtalk/voice/MMDAgent_Example-1.8/Voice/mei/mei_happy.htsvoice \
 -ow /dev/stdout \
 | aplay
echo 'こんにちは' | open_jtalk \
 -x /usr/local/dic \
 -m /home/pi/root/sys/env/tool/openjtalk/voice/akihiro0105/グリマルキン_1.0/グリマルキン_1.0.htsvoice \
 -ow /dev/stdout \
 | aplay
echo 'こんにちは。ラズベリーパイでOpenJTalkを使いしゃべらせます。' | open_jtalk \
 -x /usr/local/dic \
 -m /home/pi/root/sys/env/tool/openjtalk/voice/akihiro0105/天月りよん_1.0/天月りよん.htsvoice \
 -ow /dev/stdout \
 | aplay

 関数化してみる。

OpenJTalk() {
    echo "$1" | open_jtalk \
        -x /usr/local/dic \
        -m /home/pi/root/sys/env/tool/openjtalk/voice/hts_voice_nitech_jp_atr503_m001-1.05/nitech_jp_atr503_m001.htsvoice \
        -ow /dev/stdout \
        | aplay
}

 全ボイスを出す。

# 関数化
OpenJTalk() {
    echo "$1" | open_jtalk \
        -x /usr/local/dic \
        -m /home/pi/root/sys/env/tool/openjtalk/voice/hts_voice_nitech_jp_atr503_m001-1.05/nitech_jp_atr503_m001.htsvoice \
        -ow /dev/stdout \
        | aplay
}
AllVoiceTest() {
    local word="こんにちは。音声合成OpenJTalkを使ったテストです。喋るラズベリーパイをご堪能あれ。"
    local voices="$(find $HOME/root/sys/env/tool/openjtalk/voice/ -name *.htsvoice)"
    echo -e "$voices" | while read line; do
        OpenJTalk "$word" "$line"
    done
}
OpenJTalk

 wavファイル化する。

# 全ボイスの音声ファイル作成
OpenJTalkWav() {
    name="$(basename "$2")"
    echo "$1" | open_jtalk \
        -x /usr/local/dic \
        -m "$2" \
        -ow "$(WavFileName "$2")"
    ffmpeg -i "$name.wav" -vn -ar 44100 -ac 2 -acodec flac -f flac "$name.flac"
#  aplay "$name.flac"
}
StdOut() { echo '/dev/stdout'; }
WavFileName() {
    local name="$(basename "$1")"
    echo "${name%.}.wav"
}
AllVoiceTestWav() {
    local word="こんにちは。音声合成OpenJTalkを使ったテストです。喋るラズベリーパイをご堪能あれ。"
    local voices="$(find $HOME/root/sys/env/tool/openjtalk/voice/ -name *.htsvoice)"
    echo -e "$voices" | while read line; do
        OpenJTalkWav "$word" "$line"
    done
}
AllVoiceTestWav

 以下でFLAC形式に変換するWebサービスもある。

所感

 MMDと組合せてゆっくり動画ツール作れないかな。Linuxやラズパイで動くやつ。

対象環境

$ uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux