简体   繁体   English

在Windows 7和python 2.7上讲

[英]Espeak on windows 7 and python 2.7

On the begin I'll say that there is a similar post here: How to use espeak with python and I was using answers from this post, but still i'm getting errors, so maybe u'll be able to help me fix it. 在开始的时候,我会说这里有一个类似的帖子: 如何在python中使用espeak,我一直在使用这篇帖子的答案,但是仍然出现错误,因此也许您可以帮助我修复它。

import subprocess
text = '"Hello world"'
subprocess.call('espeak '+text, shell=True)

This code gives me an error: 这段代码给我一个错误:

'espeak' is not recognized as an internal or external command,
operable program or batch file.

ps. ps。 I think I installed espeak correctly, because I can use in CMD line: 我认为我正确安装了espeak,因为我可以在CMD行中使用:

espeak "text"

and it will say "text" correctly. 它会正确说出“文字”。

PS2. PS2。 probably answer for this question will be the answer for my another question I posted earlier. 这个问题的答案可能就是我先前发布的另一个问题的答案。 ( How to save the output of PyTTSx to wav file ) 如何将PyTTSx的输出保存到wav文件中

import subprocess
subprocess.call(['ping', '127.0.0.1'], shell=True)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM