hgneng / ekho

Chinese text-to-speech engine
GNU General Public License v2.0
1.12k stars 263 forks source link

How to build ekho for Cantonese on Ubuntu 18.04? #13

Closed mirfan899 closed 4 years ago

mirfan899 commented 5 years ago

I'm trying to use it for Cantonese(https://sourceforge.net/projects/e-guidedog/files/Ekho-Voice-Data/0.2/jyutping-wong-44100-v9.tar.bz2) but did not find where to place the data. Also when I compile it on Ubuntu 18.04 it shows something like this.

some text is ommited.
mv -f src/.deps/libekho_a-zh_symbol_map.Tpo src/.deps/libekho_a-zh_symbol_map.Po
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -D_REENTRANT  -pthread  -std=c++11 -I./libmusicxml/src/elements -I./libmusicxml/src/lib -I./libmusicxml/src/visitors -I./libmusicxml/src/files -I./libmusicxml/src/parser -g -O2 -O0 -MT src/libekho_a-symbol_array.o -MD -MP -MF src/.deps/libekho_a-symbol_array.Tpo -c -o src/libekho_a-symbol_array.o `test -f 'src/symbol_array.cpp' || echo './'`src/symbol_array.cpp
mv -f src/.deps/libekho_a-symbol_array.Tpo src/.deps/libekho_a-symbol_array.Po
depbase=`echo sonic/sonic.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT sonic/sonic.o -MD -MP -MF $depbase.Tpo -c -o sonic/sonic.o sonic/sonic.c &&\
mv -f $depbase.Tpo $depbase.Po
rm -f libekho.a
ar cru libekho.a src/libekho_a-libekho.o src/libekho_a-libekho_impl.o src/libekho_a-phonetic_symbol.o src/libekho_a-ekho_dict.o src/libekho_a-number.o src/libekho_a-musicxml.o src/libekho_a-zhy_symbol_map.o src/libekho_a-zh_symbol_map.o src/libekho_a-symbol_array.o sonic/sonic.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libekho.a
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic  -g -O2 -O0 -MT src/test_ekho-test_ekho.o -MD -MP -MF src/.deps/test_ekho-test_ekho.Tpo -c -o src/test_ekho-test_ekho.o `test -f 'src/test_ekho.cpp' || echo './'`src/test_ekho.cpp
mv -f src/.deps/test_ekho-test_ekho.Tpo src/.deps/test_ekho-test_ekho.Po
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -I./utfcpp/source -I./sonic  -g -O2 -O0   -o test_ekho src/test_ekho-test_ekho.o libekho.a -lpulse-simple -lpulse   -lsndfile -lespeak  ./libmusicxml/libmusicxml2.a -lespeak -lsndfile -lpthread 
libtool: link: g++ -I./utfcpp/source -I./sonic -g -O2 -O0 -o test_ekho src/test_ekho-test_ekho.o  libekho.a -lpulse-simple -lpulse ./libmusicxml/libmusicxml2.a -lespeak -lsndfile -lpthread
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -pthread  -lstdc++ -g -O2 -O0 -MT src/ekho-ekho.o -MD -MP -MF src/.deps/ekho-ekho.Tpo -c -o src/ekho-ekho.o `test -f 'src/ekho.cpp' || echo './'`src/ekho.cpp
mv -f src/.deps/ekho-ekho.Tpo src/.deps/ekho-ekho.Po
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -I./utfcpp/source -I./sonic -pthread  -lstdc++ -g -O2 -O0   -o ekho src/ekho-ekho.o libekho.a -lpulse-simple -lpulse   -lsndfile -lespeak   ./libmusicxml/libmusicxml2.a -lespeak -lsndfile -lpthread 
libtool: link: g++ -I./utfcpp/source -I./sonic -pthread -g -O2 -O0 -o ekho src/ekho-ekho.o  -lstdc++ libekho.a -lpulse-simple -lpulse ./libmusicxml/libmusicxml2.a -lespeak -lsndfile -lpthread -pthread
cd ./libmusicxml/linux && make
make[2]: Entering directory '/home/virtuoso_irfan/ekho/libmusicxml/linux'
make -C ../samples
make[3]: Entering directory '/home/virtuoso_irfan/ekho/libmusicxml/samples'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/virtuoso_irfan/ekho/libmusicxml/samples'
make[2]: Leaving directory '/home/virtuoso_irfan/ekho/libmusicxml/linux'
make[1]: Leaving directory '/home/virtuoso_irfan/ekho'

Is it installed without errors? Because I don't see any confirmation of ekho is being installed completely.

mirfan899 commented 5 years ago

When I try to run make install following errors occurred.

install: cannot stat './ekho-data/zh.dict': No such file or directory
install: cannot stat './ekho-data/pinyin.index': No such file or directory
install: cannot stat './ekho-data/pinyin.voice': No such file or directory
install: cannot stat './ekho-data/jyutping.index': No such file or directory
install: cannot stat './ekho-data/jyutping.voice': No such file or directory
Makefile:1400: recipe for target 'install-data-hook' failed
make[2]: *** [install-data-hook] Error 1
make[2]: Leaving directory '/home/virtuoso_irfan/ekho'
Makefile:1323: recipe for target 'install-data-am' failed
make[1]: *** [install-data-am] Error 2
make[1]: Leaving directory '/home/virtuoso_irfan/ekho'
Makefile:1268: recipe for target 'install-am' failed
make: *** [install-am] Error 2
hgneng commented 5 years ago

put Cantonese voice data to ekho/src/ekho-data/jyutping

before running make install, run ./ekho 123 and ./ekho -v Cantonese 123 to generate those files. You can also copy those files from a release package.

mirfan899 commented 5 years ago

Now, I'm getting this error when I try to run ./ekho 123

root@instance-2:/home/virtuoso_irfan/ekho# ./ekho 123
Segmentation fault (core dumped)
mirfan899 commented 5 years ago

I've removed the files and run the command again and it works but got this issue.

pa_simple_new() failed: Connection refused
pa_sample_spec(format=3,rate=44100,channels=ch=1)
Fail to init audio stream.
Fail to init sound.
hgneng commented 5 years ago

Is pulseaudio service running in your system?

$ ps -ef|grep pulse
hgneng    1432     1  0 14:33 ?        00:00:01 /usr/bin/pulseaudio --start --log-target=syslog
mirfan899 commented 5 years ago

output

root@instance-2:/home/virtuoso_irfan/ekho# ps -ef|grep pulse
root     16221     1  0 07:03 ?        00:00:00 pulseaudio -D
root     16242 29346  0 07:04 pts/0    00:00:00 grep --color=auto pulse

I think it is a system issue. I'm running Ubuntu 18.04 on GCP When I tried to run pusleaudio --start It throws the following error

E: [pulseaudio] main.c: --start not supported for system instances.
hgneng commented 5 years ago

If you are not running on a desktop, you should not hear any sound. Try to save it to a file, download to local and play:

./ekho -o demo.wav 123
mirfan899 commented 5 years ago

Great, it works. Thanks for quick response.

mirfan899 commented 5 years ago

I've some Cantonese files audio and text files, should I replace jyutping folder to build custom voice?

hgneng commented 5 years ago

Yes, you can. Remember to remove ekho-data/jyutping.* and re-generate them after replacing the voice files.

mirfan899 commented 5 years ago

It seems voice is built using audio files only. How are you doing? Is there a way to use ekho model in Merlin?

hgneng commented 5 years ago

Sorry, there is no way to use ekho model in Merlin.

mirfan899 commented 5 years ago

Is there a way to get the text files of Cantonese wav files?

hgneng commented 5 years ago

http://eguidedog.net/files/jyutping_phon_list.txt (page is encoded in utf-8)

mirfan899 commented 5 years ago

Thanks!! I check the wav files and they have short duration mostly! I've wav files with 5-10 seconds long audios. Will ekho work with these files?

hgneng commented 5 years ago

No, you should cut the silence in advanced. I suppose each file should be less than 1 second.