记ekho安装到嵌入式设备

ekho按照官方编译安装ubuntu版本.

ekho按照官方编译安装ubuntu版本的

apt-get install libsndfile1-dev libpulse-dev libncurses5-dev libmp3lame-dev libespeak-dev pulseaudio

wget –no-check-certificate https://sourceforge.net/projects/e-guidedog/files/Ekho/7.7/ekho-7.7.1.tar.xz

tar xvf ekho-7.7.1.tar.xz

cd ekho-7.7.1

./configure

make

make install

ekho “hello 123”

编译后运行发现报错

pa_simple_new() failed: Access denied

pa_sample_spec(format=3,rate=16000,channels=ch=1)

Fail to init audio stream.

Fail to init sound.

最后发现是 pulseaudio 服务里用了–system参数, 去掉即可正常使用, 具体原因还不清楚.

1) Would you please try this with user1:

sudo gpasswd -a user1 pulse-access
sudo gpasswd -a user1 pulse-rt
sudo gpasswd -a pulse audio

2) Have you tried this?

” edit /usr/local/etc/pulse/system.pa and add:

load-module module-native-protocol-unix auth-anonymous=1

Reference: https://tango.0pointer.de/pipermail/pulseaudio-discuss/2009-January/002942.html


3) Try running pulseaudio in system mode

Reference: https://bugzilla.redhat.com/attachment.cgi?id=262541


4) Make sure user2 does not run pulseaudio as root


5) Remove applications from user2 that may not release audio (e.g. timidity)


6) Go through ~/.asoundrc and /etc/asound.conf if present


7) Check if “the evil libflashsupport library” is installed. To uninstall:

 sudo aptitude purge libflashsupport flashplugin-nonfree-extrasound  

8) Start pulseaudio daemon system wide:

gksu gedit /etc/default/pulseaudio  

And change “PULSEAUDIO_SYSTEM_START=0” for “PULSEAUDIO_SYSTEM_START=1”

9) Try unplugging audio hardware like external speakers and reboot.

 

Ekho语音合成软件的原理很简单,为每一个拼音录制一个音频文件,然后拼接起来合成句子。

Ekho默认的安装包里包含的音频文件是gsm后缀的,尺寸较小,质量较低。大家可以到Ekho语音数据页面下载质量更高的语音包替换。步骤如下:

  1. 访问Ekho Voice Data页面:https://sourceforge.net/projects/e-guidedog/files/Ekho-Voice-Data/0.2/
  2. 找到需要下载的语言即版本,文件名中44100这样的数字表示音频文件的采样率,44100Hz是CD的音质。以藏语为例,应该下载tibetan-trinley-44100-wav-v1.tar.xz。文件放在国外的服务器,下载起来可能会比较慢(这里有一个藏语语音数据包国内镜像)。
  3. 下载以后解压文件,替换Ekho/ekho-data文件夹里对应的语音数据文件夹。继续以藏语为例,tibetan-trinley-44100-wav-v1.tar.xz解压后是tibetan-trinley-44100-wav,改名为tibetan,替换C:\Program Files\Ekho\ekho-data\tibetan。tibetan目录下应该有许多wav文件(而不应再嵌套一个tibetan目录)。
  4. 如果是Linux版本,并且是拼音或粤语,需要把ekho-data下的pinyin.voice和pinyin.index文件删除。
  5. 重启Ekho即可。

 

以上方法,同样适用于制作和替换自己的声音。

 

正常启动pulseaudio后, 播放声音程序都能正常运行,但是没有声音,可能是系统有多个播放设备,需要手动指定默认播放设备

aplay -l

查看正确播放设备的id后更新到asound.conf里, 重启服务

/etc/asound.conf

defaults.pcm.card 0

defaults.pcm.device 0

defaults.ctl.card 0