如何运行简单的文本到语音命令?

在Windows中,我可以执行以下步骤:

1. Open Notepad 2. Copy and Paste CreateObject("SAPI.SpVoice").Speak"Hello." 3. Save it as xyz.vbs 4. Run it/Open it 

然后它会说“你好”。 在Ubuntu中有这样的东西吗?

安装espeak 安装espeak 包。 然后在终端中运行

 espeak -v en "Hello" 

要更改语音,请参阅联机帮助页。 man espeak的摘录:

  --voices[=] Lists the available voices. If = is present then only those voices which are suitable for that language are listed. -v  Use voice file of this name from espeak-data/voices 

有一个链接可以为语音命令行工具提供详细的文本。

http://elinux.org/RPi_Text_to_Speech_%28Speech_Synthesis%29

我试过的第一个演讲包是节日。 它工作得很好,产生的声音像粗糙的发声机器人。

节日文本到语音

安装节日:

 sudo apt-get install festival 

尝试节日:

 echo “Just what do you think you're doing, Dave?” | festival --tts 

Espeak Text to Speech Espeak是一个比Festival更现代的语音合成包。 听起来更清楚,但确实有点哀嚎。 如果你正在制作外星人或RPi女巫,那么它就是你的! 说真的,这是一个很好的allrounder,具有很好的定制选项。

安装Espeak:

 sudo apt-get install espeak 

测试Espeak:英语女声,强调大写(-k),用直接文字慢慢说(-s): –

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