k-oyakata / Reports

2 stars 0 forks source link

raspberrypi with Open JTalk #2

Open k-oyakata opened 8 years ago

k-oyakata commented 8 years ago

参考

Raspberry Pi | ラズパイに喋ってもらう作戦(Open JTalk1.08のインストールと音声出力設定) – たぷん日記

Raspberry Pi でミクにしゃべらせよう | ぱわふる

k-oyakata commented 8 years ago

インストールやらビルドやら

paco

k-oyakata@raspberrypi ~ $ sudo apt-get install paco
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  paco
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 112 kB of archives.
After this operation, 286 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main paco armhf 2.0.9-2 [112 kB]
Fetched 112 kB in 1s (72.0 kB/s)         
Selecting previously unselected package paco.
(Reading database ... 64721 files and directories currently installed.)
Unpacking paco (from .../paco_2.0.9-2_armhf.deb) ...
Processing triggers for man-db ...
Setting up paco (2.0.9-2) ...
k-oyakata@raspberrypi /tmp $ sudo wget http://sourceforge.net/projects/hts-engine/files/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz
--2016-04-05 09:48:37--  http://sourceforge.net/projects/hts-engine/files/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://sourceforge.net/projects/hts-engine/files/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz [following]
--2016-04-05 09:48:37--  https://sourceforge.net/projects/hts-engine/files/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://sourceforge.net/projects/hts-engine/files/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz/download [following]
--2016-04-05 09:48:45--  https://sourceforge.net/projects/hts-engine/files/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz/download
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://downloads.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz?r=&ts=1459849732&use_mirror=nchc [following]
--2016-04-05 09:48:52--  http://downloads.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz?r=&ts=1459849732&use_mirror=nchc
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://nchc.dl.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz [following]
--2016-04-05 09:48:53--  http://nchc.dl.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz
Resolving nchc.dl.sourceforge.net (nchc.dl.sourceforge.net)... 211.79.60.17, 2001:e10:ffff:1f02::17
Connecting to nchc.dl.sourceforge.net (nchc.dl.sourceforge.net)|211.79.60.17|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 169258 (165K) [application/x-gzip]
Saving to: `hts_engine_API-1.09.tar.gz'

100%[=======================================================================>] 169,258     1.01M/s   in 0.2s    

2016-04-05 09:48:53 (1.01 MB/s) - `hts_engine_API-1.09.tar.gz' saved [169258/169258]

k-oyakata@raspberrypi /tmp $ sudo tar zxvf hts_engine_API-1.09.tar.gz
hts_engine_API-1.09/
hts_engine_API-1.09/config/
hts_engine_API-1.09/config/compile
hts_engine_API-1.09/config/config.guess
hts_engine_API-1.09/config/config.sub
hts_engine_API-1.09/config/depcomp
hts_engine_API-1.09/config/install-sh
hts_engine_API-1.09/config/missing
hts_engine_API-1.09/include/
hts_engine_API-1.09/include/HTS_engine.h
hts_engine_API-1.09/INSTALL
hts_engine_API-1.09/NEWS
hts_engine_API-1.09/README
hts_engine_API-1.09/AUTHORS
hts_engine_API-1.09/ChangeLog
hts_engine_API-1.09/Makefile.in
hts_engine_API-1.09/Makefile.am
hts_engine_API-1.09/configure
hts_engine_API-1.09/configure.ac
hts_engine_API-1.09/aclocal.m4
hts_engine_API-1.09/COPYING
hts_engine_API-1.09/Makefile.mak
hts_engine_API-1.09/lib/
hts_engine_API-1.09/lib/Makefile.in
hts_engine_API-1.09/lib/Makefile.am
hts_engine_API-1.09/lib/HTS_audio.c
hts_engine_API-1.09/lib/HTS_engine.c
hts_engine_API-1.09/lib/HTS_hidden.h
hts_engine_API-1.09/lib/HTS_misc.c
hts_engine_API-1.09/lib/HTS_pstream.c
hts_engine_API-1.09/lib/HTS_sstream.c
hts_engine_API-1.09/lib/HTS_model.c
hts_engine_API-1.09/lib/HTS_vocoder.c
hts_engine_API-1.09/lib/HTS_gstream.c
hts_engine_API-1.09/lib/HTS_label.c
hts_engine_API-1.09/lib/Makefile.mak
hts_engine_API-1.09/bin/
hts_engine_API-1.09/bin/Makefile.in
hts_engine_API-1.09/bin/Makefile.am
hts_engine_API-1.09/bin/hts_engine.c
hts_engine_API-1.09/bin/Makefile.mak
k-oyakata@raspberrypi /tmp $ 
k-oyakata commented 8 years ago

hts_engine API version 1.09 (December 25, 2014)

k-oyakata@raspberrypi /tmp $ cd /tmp/hts_engine_API-1.09/
k-oyakata@raspberrypi /tmp/hts_engine_API-1.09 $ sudo ./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
...
...
k-oyakata@raspberrypi /tmp/hts_engine_API-1.09 $ sudo make
Making all in lib
make[1]: Entering directory `/tmp/hts_engine_API-1.09/lib'
gcc -DPACKAGE_NAME=\"hts_engine_API\" -DPACKAGE_TARNAME=\"hts_engine_API\" -DPACKAGE_VERSION=\"1.09\" -DPACKAGE_STRING=\"hts_engine_API\ 1.09\" -DPACKAGE_BUGREPORT=\"hts-engine-users@lists.sourceforge.net\" -DPACKAGE_URL=\"\" -DPACKAGE=\"hts_engine_API\" -DVERSION=\"1.09\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_VPRINTF=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRRCHR=1 -DHAVE_STRSTR=1 -I.  -I ../include   -g -O2 -MT HTS_audio.o -MD -MP -MF .deps/HTS_audio.Tpo -c -o HTS_audio.o HTS_audio.c
...
...
make[1]: Leaving directory `/tmp/hts_engine_API-1.09/bin'
make[1]: Entering directory `/tmp/hts_engine_API-1.09'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/tmp/hts_engine_API-1.09'
k-oyakata@raspberrypi /tmp/hts_engine_API-1.09 $ 
k-oyakata@raspberrypi /tmp/hts_engine_API-1.09 $ sudo paco -lD "make install"
Making install in lib
make[1]: Entering directory `/tmp/hts_engine_API-1.09/lib'
make[2]: Entering directory `/tmp/hts_engine_API-1.09/lib'
 /bin/mkdir -p '/usr/local/lib'
 /usr/bin/install -c -m 644  libHTSEngine.a '/usr/local/lib'
 ( cd '/usr/local/lib' && ranlib libHTSEngine.a )
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/hts_engine_API-1.09/lib'
make[1]: Leaving directory `/tmp/hts_engine_API-1.09/lib'
Making install in bin
make[1]: Entering directory `/tmp/hts_engine_API-1.09/bin'
make[2]: Entering directory `/tmp/hts_engine_API-1.09/bin'
 /bin/mkdir -p '/usr/local/bin'
  /usr/bin/install -c hts_engine '/usr/local/bin'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/hts_engine_API-1.09/bin'
make[1]: Leaving directory `/tmp/hts_engine_API-1.09/bin'
make[1]: Entering directory `/tmp/hts_engine_API-1.09'
make[2]: Entering directory `/tmp/hts_engine_API-1.09'
make[2]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 include/HTS_engine.h '/usr/local/include'
make[2]: Leaving directory `/tmp/hts_engine_API-1.09'
make[1]: Leaving directory `/tmp/hts_engine_API-1.09'
k-oyakata@raspberrypi /tmp/hts_engine_API-1.09 $ 
k-oyakata commented 8 years ago

Open JTalk 1.08

k-oyakata@raspberrypi /tmp $ sudo wget http://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz
--2016-04-05 09:54:19--  http://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz [following]
--2016-04-05 09:54:19--  https://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz/download [following]
--2016-04-05 09:54:26--  https://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz/download
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://downloads.sourceforge.net/project/open-jtalk/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz?r=&ts=1459850074&use_mirror=iweb [following]
--2016-04-05 09:54:34--  http://downloads.sourceforge.net/project/open-jtalk/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz?r=&ts=1459850074&use_mirror=iweb
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://iweb.dl.sourceforge.net/project/open-jtalk/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz [following]
--2016-04-05 09:54:34--  http://iweb.dl.sourceforge.net/project/open-jtalk/Open%20JTalk/open_jtalk-1.08/open_jtalk-1.08.tar.gz
Resolving iweb.dl.sourceforge.net (iweb.dl.sourceforge.net)... 70.38.0.134, 2607:f748:10:12::5f:2
Connecting to iweb.dl.sourceforge.net (iweb.dl.sourceforge.net)|70.38.0.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14235254 (14M) [application/x-gzip]
Saving to: `open_jtalk-1.08.tar.gz'

100%[=======================================================================>] 14,235,254   150K/s   in 1m 53s  

2016-04-05 09:56:27 (123 KB/s) - `open_jtalk-1.08.tar.gz' saved [14235254/14235254]

k-oyakata@raspberrypi /tmp $ 
k-oyakata@raspberrypi /tmp $ sudo tar zxvf open_jtalk-1.08.tar.gz
open_jtalk-1.08/
open_jtalk-1.08/config/
open_jtalk-1.08/config/compile
open_jtalk-1.08/config/config.guess
open_jtalk-1.08/config/config.sub
open_jtalk-1.08/config/depcomp
open_jtalk-1.08/config/install-sh
...
...
open_jtalk-1.08/mecab-naist-jdic/pos-id.def
open_jtalk-1.08/mecab-naist-jdic/rewrite.def
open_jtalk-1.08/mecab-naist-jdic/right-id.def
open_jtalk-1.08/mecab-naist-jdic/char.def
open_jtalk-1.08/mecab-naist-jdic/unk.def
open_jtalk-1.08/mecab-naist-jdic/feature.def
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ 
k-oyakata commented 8 years ago
k-oyakata@raspberrypi /tmp $ cd open_jtalk-1.08/
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ sudo ./configure --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... no
checking for mawk... mawk
...
...
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
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ 
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ sudo make
Making all in text2mecab
make[1]: Entering directory `/tmp/open_jtalk-1.08/text2mecab'
gcc -DHAVE_CONFIG_H -I. -I../mecab  -D CHARSET_UTF_8   -O2 -Wall -g -g -O2 -finput-charset=UTF-8 -fexec-charset=UTF-8  -MT text2mecab.o -MD -MP -MF .deps/text2mecab.Tpo -c -o text2mecab.o text2mecab.c
mv -f .deps/text2mecab.Tpo .deps/text2mecab.Po
rm -f libtext2mecab.a
ar cru libtext2mecab.a text2mecab.o 
ranlib libtext2mecab.a
...
...
done!
make[1]: Leaving directory `/tmp/open_jtalk-1.08/mecab-naist-jdic'
make[1]: Entering directory `/tmp/open_jtalk-1.08'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/tmp/open_jtalk-1.08'
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ sudo paco -lD "make install"
Making install in text2mecab
make[1]: Entering directory `/tmp/open_jtalk-1.08/text2mecab'
make[2]: Entering directory `/tmp/open_jtalk-1.08/text2mecab'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/open_jtalk-1.08/text2mecab'
make[1]: Leaving directory `/tmp/open_jtalk-1.08/text2mecab'
Making install in mecab
...
...
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/open_jtalk-1.08'
make[1]: Leaving directory `/tmp/open_jtalk-1.08'
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ 
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ paco -a
hts_engine_API-1.09  open_jtalk-1.08
k-oyakata@raspberrypi /tmp/open_jtalk-1.08 $ 
k-oyakata commented 8 years ago

Dictionary for Open JTalk version 1.08 (25 December, 2014)

k-oyakata@raspberrypi ~ $ cd /tmp
k-oyakata@raspberrypi /tmp $ sudo wget http://sourceforge.net/projects/open-jtalk/files/Dictionary/open_jtalk_dic-1.08/open_jtalk_dic_utf_8-1.08.tar.gz
--2016-04-05 13:05:23--  http://sourceforge.net/projects/open-jtalk/files/Dictionary/open_jtalk_dic-1.08/open_jtalk_dic_utf_8-1.08.tar.gz
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://sourceforge.net/projects/open-jtalk/files/Dictionary/open_jtalk_dic-1.08/open_jtalk_dic_utf_8-1.08.tar.gz [following]
--2016-04-05 13:05:23--  https://sourceforge.net/projects/open-jtalk/files/Dictionary/open_jtalk_dic-1.08/open_jtalk_dic_utf_8-1.08.tar.gz
...
...
Connecting to liquidtelecom.dl.sourceforge.net (liquidtelecom.dl.sourceforge.net)|197.155.77.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14787242 (14M) [application/x-gzip]
Saving to: `open_jtalk_dic_utf_8-1.08.tar.gz'

100%[=======================================================================>] 14,787,242  64.7K/s   in 6m 43s  

2016-04-05 13:12:22 (35.8 KB/s) - `open_jtalk_dic_utf_8-1.08.tar.gz' saved [14787242/14787242]

k-oyakata@raspberrypi /tmp $ 
k-oyakata@raspberrypi /tmp $ sudo tar zxvf open_jtalk_dic_utf_8-1.08.tar.gz
open_jtalk_dic_utf_8-1.08/
open_jtalk_dic_utf_8-1.08/char.bin
open_jtalk_dic_utf_8-1.08/left-id.def
open_jtalk_dic_utf_8-1.08/matrix.bin
open_jtalk_dic_utf_8-1.08/pos-id.def
open_jtalk_dic_utf_8-1.08/rewrite.def
open_jtalk_dic_utf_8-1.08/right-id.def
open_jtalk_dic_utf_8-1.08/sys.dic
open_jtalk_dic_utf_8-1.08/unk.dic
open_jtalk_dic_utf_8-1.08/COPYING
k-oyakata@raspberrypi /tmp $ sudo mkdir /usr/local/share/open_jtalk
k-oyakata@raspberrypi /tmp $ sudo mv /tmp/open_jtalk_dic_utf_8-1.08 /usr/local/share/open_jtalk/
k-oyakata@raspberrypi /tmp $ 
k-oyakata commented 8 years ago

MMDAgent(version 1.4 )

k-oyakata@raspberrypi /tmp $ cd /tmp
k-oyakata@raspberrypi /tmp $ sudo wget http://sourceforge.net/projects/mmdagent/files/MMDAgent_Example/MMDAgent_Example-1.4/MMDAgent_Example-1.4.zip
--2016-04-05 13:14:49--  http://sourceforge.net/projects/mmdagent/files/MMDAgent_Example/MMDAgent_Example-1.4/MMDAgent_Example-1.4.zip
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://sourceforge.net/projects/mmdagent/files/MMDAgent_Example/MMDAgent_Example-1.4/MMDAgent_Example-1.4.zip [following]
...
...
Connecting to iweb.dl.sourceforge.net (iweb.dl.sourceforge.net)|70.38.0.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11706517 (11M) [application/octet-stream]
Saving to: `MMDAgent_Example-1.4.zip'

100%[=======================================================================>] 11,706,517   133K/s   in 2m 23s  

2016-04-05 13:17:28 (79.8 KB/s) - `MMDAgent_Example-1.4.zip' saved [11706517/11706517]

k-oyakata@raspberrypi /tmp $ 
k-oyakata@raspberrypi /tmp $ sudo unzip MMDAgent_Example-1.4.zip
Archive:  MMDAgent_Example-1.4.zip
   creating: MMDAgent_Example-1.4/Accessory/
   creating: MMDAgent_Example-1.4/Accessory/bootscreen/
  inflating: MMDAgent_Example-1.4/Accessory/bootscreen/bootscreen.pmd
...
...
  inflating: MMDAgent_Example-1.4/Voice/mei/mei_normal.htsvoice  
  inflating: MMDAgent_Example-1.4/Voice/mei/mei_sad.htsvoice  
  inflating: MMDAgent_Example-1.4/Voice/mei/README.txt  
k-oyakata@raspberrypi /tmp $ sudo mkdir /usr/local/share/hts_voice
k-oyakata@raspberrypi /tmp $ sudo mv /tmp/MMDAgent_Example-1.4/Voice/mei /usr/local/share/hts_voice/
k-oyakata@raspberrypi /tmp $ 
k-oyakata commented 8 years ago

オーディオ出力の設定

k-oyakata@raspberrypi ~ $ sudo vi /boot/config.txt 
...
...
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2  <- コメントを外す
...
...
オーディオ出力端子に出力する場合
k-oyakata@raspberrypi ~ $ amixer cset mumid=3 1
HDMI端子に出力する場合
k-oyakata@raspberrypi ~ $ amixer cset mumid=3 2
k-oyakata commented 8 years ago

出力テスト

k-oyakata@raspberrypi ~ $ speaker-test 

speaker-test 1.0.25

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
Playback open error: -2,No such file or directory

audioグループに入っていないとデバイスが見えないみたい

k-oyakata@raspberrypi ~ $ sudo gpasswd -a k-oyakata audio
Adding user k-oyakata to group audio

所属グループを変更したので、ログアウトして再度ログイン

k-oyakata@raspberrypi ~ $ exit
logout
Connection to 192.168.1.229 closed.
ganesa:~ sasakikoukichi$ ssh k-oyakata@192.168.1.229  -o PreferredAuthentications=password
k-oyakata@192.168.1.229's password: 
Linux raspberrypi 3.6.11+ #474 PREEMPT Thu Jun 13 17:14:42 BST 2013 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Apr  6 03:00:17 2016 from 192.168.1.198

実行できた

k-oyakata@raspberrypi ~ $ speaker-test 

speaker-test 1.0.25

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 512 to 32768
Period size range from 512 to 32768
Using max buffer size 32768
Periods = 4
was set period_size = 8192
was set buffer_size = 32768
 0 - Front Left
Time per period = 2.235717
 0 - Front Left
Time per period = 2.908590
 0 - Front Left

Time per period = 2.898613
 0 - Front Left
Time per period = 2.898785
 0 - Front Left
...
...
k-oyakata commented 8 years ago

日本語を喋らせるスクリプト

k-oyakata@raspberrypi ~ $ cat /usr/local/bin/jsay 
#!/bin/sh

# 引数チェック
CMDNAME=`basename $0`
if [ $# -lt 1 ]; then
    echo "Usage: ${CMDNAME} [ text ]" 1>&2
    exit 1
fi

# 定数定義(出力ファイル名、辞書の場所、音声データの場所)
TMPFILE=`mktemp /tmp/tmp.XXXXXXXX.wav`
DIC=/usr/local/share/open_jtalk/open_jtalk_dic_utf_8-1.08/
VOICE=/usr/local/share/hts_voice/mei/mei_normal.htsvoice

# 音声データ生成
echo "$1" | open_jtalk \
-x ${DIC} \
-m ${VOICE} \
-ow ${TMPFILE} && \

# 生成した音声データを再生する
aplay --quiet ${TMPFILE}

# 生成した音声データを削除する
rm -f ${TMPFILE}

# 終了
exit 0