在树莓派B+上编译使用ekho的问题

发布于 2021-11-27 18:10:15 字数 17211 浏览 851 评论 6

我在树莓派一代B+(raspbian系统)上编译ekho,按照官方的文档安装,安装完后,执行命令ekho “hello 123”

提示:

pi@raspberrypi ~/ekho-6.3 $ ekho ¨hello 123¨
pa_simple_new() failed: Connection refused
pa_sample_spec(format=3,rate=16000,channels=ch=1)
Fail to init audio stream.
Fail to init sound.

@黄冠能  能帮忙看看是什么问题么?

以下是部分安装过程:

pi@raspberrypi ~ $ cd ekho-6.3
pi@raspberrypi ~/ekho-6.3 $ ./configure --enable-festival
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 ar... ar
checking the archiver (ar) interface... ar
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
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking dependency style of gcc... gcc3
checking build system type... armv6l-unknown-linux-gnueabihf
checking host system type... armv6l-unknown-linux-gnueabihf
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert armv6l-unknown-linux-gnueabihf file names to armv6l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv6l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %sn
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -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 dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
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 how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking whether make sets $(MAKE)... (cached) yes
checking for main in -lpthread... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking whether closedir returns void... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working strtod... yes
checking for memset... yes
checking for setlocale... yes
checking for strstr... yes
checking for main in -lsndfile... yes
checking for main in -lpulse... yes
checking for main in -lncurses... yes
checking for main in -lestools... yes
checking for main in -lFestival... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands


pi@raspberrypi ~/ekho-6.3 $ make CXXFLAGS=-DNO_SSE
make  all-am
make[1]: Entering directory '/home/pi/ekho-6.3'
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -D_REENTRANT   -I/usr/include/festival -I/usr/include/speech_tools -I./sr-convert -DOUTPUT16BIT -D_`uname -p` -pthread  -DNO_SSE -MT src/libekho_a-libekho.o -MD -MP -MF src/.deps/libekho_a-libekho.Tpo -c -o src/libekho_a-libekho.o `test -f 'src/libekho.cpp' || echo './'`src/libekho.cpp
src/libekho.cpp: In member function ‘int ekho::Ekho::init()’:
src/libekho.cpp:79:23: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
src/libekho.cpp:79:23: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
src/libekho.cpp:80:22: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
src/libekho.cpp:80:22: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
mv -f src/.deps/libekho_a-libekho.Tpo src/.deps/libekho_a-libekho.Po
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -D_REENTRANT   -I/usr/include/festival -I/usr/include/speech_tools -I./sr-convert -DOUTPUT16BIT -D_`uname -p` -pthread  -DNO_SSE -MT src/libekho_a-ekho_dict.o -MD -MP -MF src/.deps/libekho_a-ekho_dict.Tpo -c -o src/libekho_a-ekho_dict.o `test -f 'src/ekho_dict.cpp' || echo './'`src/ekho_dict.cpp
mv -f src/.deps/libekho_a-ekho_dict.Tpo src/.deps/libekho_a-ekho_dict.Po
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -D_REENTRANT   -I/usr/include/festival -I/usr/include/speech_tools -I./sr-convert -DOUTPUT16BIT -D_`uname -p` -pthread  -DNO_SSE -MT src/libekho_a-number.o -MD -MP -MF src/.deps/libekho_a-number.Tpo -c -o src/libekho_a-number.o `test -f 'src/number.cpp' || echo './'`src/number.cpp
mv -f src/.deps/libekho_a-number.Tpo src/.deps/libekho_a-number.Po
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -D_REENTRANT   -I/usr/include/festival -I/usr/include/speech_tools -I./sr-convert -DOUTPUT16BIT -D_`uname -p` -pthread  -DNO_SSE -MT sr-convert/libekho_a-dsp.o -MD -MP -MF sr-convert/.deps/libekho_a-dsp.Tpo -c -o sr-convert/libekho_a-dsp.o `test -f 'sr-convert/dsp.cpp' || echo './'`sr-convert/dsp.cpp
mv -f sr-convert/.deps/libekho_a-dsp.Tpo sr-convert/.deps/libekho_a-dsp.Po
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -D_REENTRANT   -I/usr/include/festival -I/usr/include/speech_tools -I./sr-convert -DOUTPUT16BIT -D_`uname -p` -pthread  -DNO_SSE -MT src/libekho_a-zhy_symbol_map.o -MD -MP -MF src/.deps/libekho_a-zhy_symbol_map.Tpo -c -o src/libekho_a-zhy_symbol_map.o `test -f 'src/zhy_symbol_map.cpp' || echo './'`src/zhy_symbol_map.cpp
zhy_symbol_map:6:14: warning: declaration ‘struct ekho::SymbolCode’ does not declare anything [enabled by default]
mv -f src/.deps/libekho_a-zhy_symbol_map.Tpo src/.deps/libekho_a-zhy_symbol_map.Po
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic -D_REENTRANT   -I/usr/include/festival -I/usr/include/speech_tools -I./sr-convert -DOUTPUT16BIT -D_`uname -p` -pthread  -DNO_SSE -MT src/libekho_a-zh_symbol_map.o -MD -MP -MF src/.deps/libekho_a-zh_symbol_map.Tpo -c -o src/libekho_a-zh_symbol_map.o `test -f 'src/zh_symbol_map.cpp' || echo './'`src/zh_symbol_map.cpp
zh_symbol_map:6:14: warning: declaration ‘struct ekho::SymbolCode’ does not declare anything [enabled by default]
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   -I/usr/include/festival -I/usr/include/speech_tools -I./sr-convert -DOUTPUT16BIT -D_`uname -p` -pthread  -DNO_SSE -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-ekho_dict.o src/libekho_a-number.o sr-convert/libekho_a-dsp.o src/libekho_a-zhy_symbol_map.o src/libekho_a-zh_symbol_map.o src/libekho_a-symbol_array.o sonic/sonic.o 
ranlib libekho.a
g++ -DHAVE_CONFIG_H -I.    -I./utfcpp/source -I./sonic  -DNO_SSE -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  -DNO_SSE   -o test_ekho src/test_ekho-test_ekho.o libekho.a -lpulse-simple -lpulse   -lFestival -lestbase -lestools -leststring -lncurses  -lsndfile  -lestools -lsndfile -lpthread 
libtool: link: g++ -I./utfcpp/source -I./sonic -DNO_SSE -o test_ekho src/test_ekho-test_ekho.o  libekho.a -lpulse-simple -lpulse -lFestival -lestbase -leststring -lncurses -lestools -lsndfile -lpthread
g++ -DHAVE_CONFIG_H -I.    -I./include -I./utfcpp/source -I./sonic -pthread  -DNO_SSE -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./include -I./utfcpp/source -I./sonic -pthread  -DNO_SSE   -o ekho src/ekho-ekho.o libekho.a -lpulse-simple -lpulse   -lFestival -lestbase -lestools -leststring -lncurses  -lsndfile   -lestools -lsndfile -lpthread 
libtool: link: g++ -I./include -I./utfcpp/source -I./sonic -pthread -DNO_SSE -o ekho src/ekho-ekho.o  libekho.a -lpulse-simple -lpulse -lFestival -lestbase -leststring -lncurses -lestools -lsndfile -lpthread -pthread
make[1]: Leaving directory '/home/pi/ekho-6.3'


pi@raspberrypi ~/ekho-6.3 $ sudo make install
make[1]: Entering directory '/home/pi/ekho-6.3'
 /bin/mkdir -p '/usr/local/bin'
  /bin/bash ./libtool   --mode=install /usr/bin/install -c test_ekho ekho '/usr/local/bin'
libtool: install: /usr/bin/install -c test_ekho /usr/local/bin/test_ekho
libtool: install: /usr/bin/install -c ekho /usr/local/bin/ekho
 /bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 src/ekho.h src/ekho_dict.h src/character.h src/phonetic_symbol.h src/zhy_symbol_map.h src/zh_symbol_map.h '/usr/local/include'
make  install-data-hook
make[2]: Entering directory '/home/pi/ekho-6.3'
mkdir -p /usr/local/share/ekho-data
cp -rLf ./ekho-data/alphabet ./ekho-data/hakka ./ekho-data/tibetan ./ekho-data/ngangien ./ekho-data/hangul /usr/local/share/ekho-data/
install ./ekho-data/zhy_list ./ekho-data/zh_list ./ekho-data/zh_listx ./ekho-data/zhy.dict ./ekho-data/zh.dict ./ekho-data/ka_list ./ekho-data/bo_list ./ekho-data/ko_list ./ekho-data/ngangien_list ./ekho-data/pinyin.index ./ekho-data/pinyin.voice ./ekho-data/jyutping.index ./ekho-data/jyutping.voice /usr/local/share/ekho-data/
cp -rf ./ekho-data/festival /usr/local/share/ekho-data/
make[2]: Leaving directory '/home/pi/ekho-6.3'
make[1]: Leaving directory '/home/pi/ekho-6.3'

pi@raspberrypi ~/ekho-6.3 $ ekho --help
Ekho text-to-speech engine.
Version: 6.3


Syntax: ekho [option] [text]
-v, --voice=VOICE
        Specified language or voice. ('Cantonese', 'Mandarin', 'Hakka', 'Tibetan', 'Ngangien' and 'Hangul' are available now. Mandarin is the default language.)
-l, --symbol
        List phonetic symbol of text. Characters' symbols are splited by space.
-f, --file=FILE
        Speak text file. ('-' for stdin)
-o, --output=FILE
        Output to file.
-t, --type=OUTPUT_TYPE
        Output type: wav(default), ogg or mp3
-p, --pitch=PITCH_DELTA
        Set delta pitch. Value range from -100 to 100 (percent)
-a, --volume=VOLUME_DELTA
        Set delta volume. Value range from -100 to 100 (percent)
-r, --rate=RATE
        Set delta rate (this scales pitch and speed at the same time). Value range from -50 to 100 (percent)
-s, --speed=SPEED
        Set delta speed. Value range from -50 to 300 (percent)
--server
        Start Ekho TTS server.
--request=TEXT
        Send request to Ekho TTS server.
--port
        Set server port. Default is 2046.
--version
        Show version number.
-h, --help
        Display this help message.


Please report bugs to Cameron Wong (hgneng at gmail.com)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

简单气质女生网名 2021-12-01 01:24:45

我使用aplay命令播放wav文件是有声音的,使用espeak也是有声音的

吃颗糖壮壮胆 2021-12-01 00:08:49

我使用sudo apt-get install pulseaudio ,安装完后使用ekho “hello”,能播放声音了,但是声音一直是杂音,听不到内容

睫毛上残留的泪 2021-11-30 21:49:20

好吧,安装了pulseaudio后,所有声音都有问题了,只有再折腾折腾了

倚栏听风 2021-11-30 18:50:52

ekho 123 -o demo.wav && aplay demo.wav播放的声音是否正常?如果不正常,能否把demo.wav发我邮箱(hgneng at 163 com)?

百思不得你姐 2021-11-30 17:57:31

回复
demo.wav文件是正常的,可以听清楚,就是有点杂音。看来还是pulseaudio的原因,现在wav文件都播放不正常了

醉生梦死 2021-11-30 15:12:34

可能
raspbian系统没有使用pulseaudio作为声音服务程序,怎样启用这个声音服务程序我不是很熟悉,暂时没有建议。你试试./ekho 123 -o demo.wav,然后play demo.wav看有没有声音。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文