语音控制 python_python有没有语音控制模块

展开全部

SAPI是微软Speech API ,

是微软公司推出的62616964757a686964616fe4b893e5b19e31333361313331语音接口,而细心的人会发现从WINXP开始,系统上就已经有语音识别的功能了,可是用武之地相当之少,他并没有给出一些人性化的自定义

方案,仅有的语音操控命令显得相当鸡胁。 那么这篇文章的任务就是利用SAPI进行个性化的语音识别。defcallback(phrase, listener):

print(": %s"%phrase)

ifphrase ==closeMainSystem:

speech.say("Goodbye. 人机交互即将关闭,谢谢使用")

listener.stoplistening()

sys.exit()

elifphrase ==openEclipse:

speech.say("请问您要写PYTHON还是JAVA程序?")

speech.listenforanything(callback)

elifphrase ==listenMusic:

speech.say("即将为你启动豆瓣电台")

webbrowser.open_new("http://douban.fm/")

elifphrase ==blog:

speech.say("即将进入Dreamforce.me")

webbrowser.open_new("http://dreamforce.me/")

elifphrase ==php:

speech.say("启动PHP编写器")

os.popen("E:\IDE\php_eclipse\eclipse\eclipse.exe")

elifphrase ==php:

speech.say("启动JAVA编写器")

os.popen("E:\IDE\php_eclipse\eclipse\eclipse.exe")

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值