歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 12.04下StarDict發音的設置

Ubuntu 12.04下StarDict發音的設置

日期:2017/2/28 15:29:52   编辑:Linux教程

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

  1. #!/bin/sh
  2. stardict_path="/win/c/edward/dic_sound"
  3. until [ -z "$1" ]
  4. do
  5. lowerword=`echo "$1" | tr A-Z a-z`
  6. firstchar=`expr substr "$lowerword" 1 1`
  7. case $firstchar in
  8. [0-9]) firstchar=0;;
  9. esac
  10. mp3_file="$stardict_path/$firstchar/${1}.mp3"
  11. if [ -e "$mp3_file" ]; then
  12. mpg321 "$mp3_file"
  13. else
  14. espeak "$1"
  15. fi
  16. shift
  17. done
  18. exit 0

5 設置stardict

6. 重新啟動詞典

Copyright © Linux教程網 All Rights Reserved