Espeak 短语停在第一个单词 os

Espeak phrase stops on the first word with os

为什么 espeak 无法读取长行短语?

text = "Do Androids Dream of Electric Sheep?"

os.system('.\espeak.exe %(text)s' % locals())

而我只有"Do...",这里也一样:

os.system(".\espeak.exe \'Do Androids Dream of Electric Sheep?\' ")

我必须做什么?

我尝试了以下方法,它对我有用。我正在使用 Windows 2013Python 2.7.

我们需要用'_'(下划线)连接单词。不知何故,使用空白 space 的单词分隔似乎会引起问题。

text = "Do Androids Dream of Electric Sheep?"  #Your original text
text = text.replace(" ", "_")                  #join words with underscore
os.system('.\espeak.exe %(text)s' % locals()) #speak words

编辑 实际上跟随比仅仅在单词之间引入特殊字符如“,”或“_”更有效。

来自eSpeak site

-克 字差。此选项在单词之间插入停顿。该值是暂停的长度,以 10 毫秒为单位(默认速度为 170 wpm)。

这是工作代码:

text = 'Do Androids Dream of Electric Sheep?'
text = text.replace(' ', '_')
os.system('.\espeak.exe  -g 20 %(text)s'  % locals())