2017年7月12日 星期三

Linux下實現語音播時shell script - 利用百度

1. 安裝mplayer套件
sudo apt-get update
sudo apt-get install mplayer 
2. 利用shell script,配合百度的語音功能,達成語音播時的功能。
#!/bin/sh
while :
do
       line=`date +%T`
       mplayer  -af volume=30 "http://tts.baidu.com/text2audio?lan=zh&pid=101&ie=UTF-8&text=現在時間是$line&spd=3"
       sleep 5
done
2. 參考來源
http://5aimiku.com/archives/440

沒有留言:

張貼留言