1.1 下载 WyabdcRealPeopleTTS
https://code.google.com/p/stardict-3/downloads/detail?name=WyabdcRealPeopleTTS.tar.bz2&can=2&q=
https://stardict-3.googlecode.com/files/WyabdcRealPeopleTTS.tar.bz2
1.2 解压 WyabdcRealPeopleTTS
$ sudo tar -xvf WyabdcRealPeopleTTS.tar.bz2 -C /usr/share
1.3 安装
$ sudo apt-get install espeak festival
$ sudo apt-get install stardict-plugin-espeak stardict-plugin-festival
1.4 这时打开 StarDict, 查字,
然后按
Pronounce the word -> Espeak TTS
或
Pronounce the word -> Festival TTS
已经可以发出声音了
2. 安装 OtdRealPeopleTTS (需要至少 3G 空间)
2.1 下载 OtdRealPeopleTTS(需下载112.3M,安装后会消耗2.9G空间)
http://download.lesca.me/OtdRealPeopleTTS.tar.gz
2.2 解压 OtdRealPeopleTTS
$ sudo tar -xvf OtdRealPeopleTTS.tar.gz -C /usr/share/
2.3 安装
$ sudo apt-get install python mpg321
$ cd /usr/share/OtdRealPeopleTTS
$ ./INSTALL
2.4 设置发音库和发音脚本路径
按右下角 Preferences -> Dictionary -> Sound
设置如图, Enable sound event 和将 RealPeopleTTS 所安装的路径写入
/usr/share/WyabdcRealPeopleTTS
/usr/share/OtdRealPeopleTTS
还有 Use TTS program, Commandline 写入
/home/user_id/speakall %s &
2.5 建立执行档 (chmod 755) speakall
======= Start of File ============
#!/bin/sh
# OtdRealPeopleTTS 所在路径
# stardict_path="$HOME/.stardict"
stardict_path="/usr/share"
for i in $@
do
lowerword=`echo $i | tr A-Z a-z`
firstchar=`expr substr $lowerword 1 1`
case $firstchar in
[0-9]) firstchar=0;;
esac
mp3_file="$stardict_path/OtdRealPeopleTTS/$firstchar/$lowerword.mp3"
if [ -e $mp3_file ]; then
mpg321 $mp3_file
else
espeak $i --stdout | aplay # 可能要改为 play 或 paplay
fi
shift
done
exit 0
======== End of File ===========
2.6 这时打开 StarDict, 查字,
然后按 Pronounce the word -> Command TTS
已经可以发出声音了
如果不行, 可能还需要安装发音工具
a) $ sudo apt-get install sox
b) 还有 speakall 里的 aplay 字眼, 可能要改去 play 或 paplay
原文:http://wiki.ubuntu.org.cn/Stardict
没有评论:
发表评论