python speech recognition 声音识别

做了一个小小的语音识别的实验

运行环境:

windows 7(自带语音识别模块,,不需要另外安装)

python 2.7 32bit

speech(https://pypi.python.org/pypi/speech/0.5.2https://code.google.com/p/pyspeech/,安装的时候下载的speech的egg包,然后在本地调用 easy install安装完成 python easy_install.py xxxxx.egg)

pywin32 (这个下载32bit或64bit的要和机器上装的python版本对应。一开始我以为自己的机器是64bit的所以安装了64bit的,结果后来发现不行。经过确认发现竟然之前装的python是32bit的)

import speechimport timeresponse = speech.input("Say something, please.")speech.say("You said " + response)def callback(phrase, listener):if phrase == "goodbye":listener.stoplistening()speech.say(phrase)print phraselistener = speech.listenforanything(callback)while listener.islistening():time.sleep(.5)语音识别一开始效果很差,经过反复训练,开始变的准确很多。嗓子有点哑了。。。。。。。。。。。。

版权声明:本文为博主原创文章,未经博主允许不得转载。

有了你,我不再作孤飞于蓝天的雄鹰,

python speech recognition 声音识别

相关文章:

你感兴趣的文章:

标签云: