首页 树莓派正文

三种方法在树莓派上实现文字转语音服务

云水 树莓派 2020-01-06 19:11:29 1522 0 树莓派

方法1:Festival Text to Speech

sudo apt-get install festival
echo “Just what do you think you're doing, Dave?” | festival --tts
speak RPi’s IP address:
hostname -I | festival -tts

方法2:Espeak Text to Speech

sudo apt-get install espeak
espeak -ven+f3 -k5 -s150 "I've just picked up a fault in the AE35 unit"

方法3:Google Text to Speech

sudo nano /etc/mplayer/mplayer.conf

添加一行

nolirc=yes

创建 speech.sh 脚本

nano speech.sh

内容如下:

#!/bin/bash
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=en&q=$*"; }
say $*

脚本授权,执行脚本。

chmod u+x speech.sh
./speech.sh Look Dave, I can see you're really upset about this.

参考连接:http://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)


版权声明

1.本站大部分下载资源收集于网络,不保证其完整性以及安全性,请下载后自行测试。
2.本站资源仅供学习和交流使用,版权归资源原作者所有,请在下载后24小时之内自觉删除。
3.若作商业用途,请购买正版,由于未及时购买和付费发生的侵权行为,与本站无关。
4.若内容涉及侵权或违法信息,请联系本站管理员进行下架处理,邮箱ganice520@163.com(本站不支持其他投诉反馈渠道,谢谢合作)

本文链接:http://apod.cc/index.php/post/226.html

发表评论

评论列表(0人评论 , 1522人围观)
☹还没有评论,来说两句吧...