查看: 1486|回复: 0
收起左侧

[参考] 树莓派上实现文字转语音服务

2019-8-13 03:30:45 | 显示全部楼层 |阅读模式
这里的输入是英文词句。
方法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)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

热点推荐

关注我们,了解更多

官方微信

服务时间:10:00-16:00

13714503811

公司地址:深圳市龙岗区南湾街道东门头路8号

Copyright © 2012-2020 Powered by 树莓派论坛 2019.4  粤ICP备15075382号-1
快速回复 返回列表 返回顶部