加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

在windows10上用python播放声音。使用pyttsx包

(2016-02-02 14:46:09)
标签:

it

开源

在windows10上用python播放声音。使用pyttsx包


1,安装python 2.7.11

https://www.python.org/

2,  设置环境变量

在设置中搜索,设置两个path路径。
C:\Python27 and    C:\Python27\Scripts

3, 安装pyttsx

widows 命令行下运行:pip install pyttsx



4,安装pywin32.要安装对应的版本啊。

Step 2: Installing pywin32

The pyttsx library/package has a dependence of pywin32, so you need to install this package also. In this using pip is not a good idea and most circumstances the installation will fail. So the best method is install pywin32 is by downloading the .exe file from the pywin32 Source Forge website.

5,安装pycharm.(可以不安装,不过,推荐安装)

https://www.jetbrains.com/pycharm/

6,运行下面代码。


import pyttsx
engine = pyttsx.init()
engine.say('Sally sells seashells by the seashore.')
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()

YeS  you WIN! It works now!

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有