1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 树莓派文字转语音 python_树莓派3-语音-实现文字转语音服务

树莓派文字转语音 python_树莓派3-语音-实现文字转语音服务

时间:2020-04-19 03:05:06

相关推荐

树莓派文字转语音 python_树莓派3-语音-实现文字转语音服务

实现文字转语音服务

说明

实现文字通过语音读出来

方法

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 "/translate_tts?tl=en&q=$*"; }

say $*

脚本授权,执行脚本

chmod u+x speech.sh

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

参考:

/RPi_Text_to_Speech_(Speech_Synthesis)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。