歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux教程

Ubuntu 12.04下StarDict發音的設置

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.  
  4. until [ -z "$1" ]  
  5. do  
  6.     lowerword=`echo "$1" | tr A-Z a-z`  
  7.     firstchar=`expr substr "$lowerword" 1 1`  
  8.     case $firstchar in  
  9.          [0-9]) firstchar=0;;  
  10.     esac  
  11.  
  12.     mp3_file="$stardict_path/$firstchar/${1}.mp3" 
  13.     if [ -e "$mp3_file" ]; then         
  14.         mpg321 "$mp3_file" 
  15.     else  
  16.         espeak "$1" 
  17.     fi  
  18.     shift  
  19. done  
  20. exit 0 

5 設置stardict

6. 重新啟動詞典

Copyright © Linux教程網 All Rights Reserved