1. Ubuntu 12.04下安装stardict,需要的词典和语音词库(我用的是网上下来的14w词汇的发音库)
2. 安装语音引擎
/usr/share/WyabdcRealPeopleTTS
/usr/share/OtdRealPeopleTTS
3. 安装mpg321用于播放mp3格式的单词语音文件
sudo apt-get install mpg321
4. 脚本 /data/depot/utils/shell/myespeak
修改脚本的权限 chmod 755 /data/depot/utils/shell/myespeak
- #!/bin/sh
- stardict_path=“/win/c/edward/dic_sound”
- until [ -z “$1” ]
- do
- lowerword=`echo “$1” | tr A-Z a-z`
- firstchar=`expr substr “$lowerword” 1 1`
- case $firstchar in
- [0–9]) firstchar=0;;
- esac
- mp3_file=“$stardict_path/$firstchar/${1}.mp3”
- if [ -e “$mp3_file” ]; then
- mpg321 “$mp3_file”
- else
- espeak “$1”
- fi
- shift
- done
- exit 0
5 设置stardict
6. 重新启动词典