【发布时间】:2011-02-02 11:37:04
【问题描述】:
嘿嘿 我正在寻找在 python 中构建一个代码,它将识别我通过麦克风说话并转换为语音, 你能给我几个高效的语音处理库来实现同样的目标吗?
【问题讨论】:
嘿嘿 我正在寻找在 python 中构建一个代码,它将识别我通过麦克风说话并转换为语音, 你能给我几个高效的语音处理库来实现同样的目标吗?
【问题讨论】:
蜻蜓示例代码在https://pythonhosted.org/dragonfly/提供代码示例时错过了sn-p
from dragonfly.all import Grammar, CompoundRule
# Voice command rule combining spoken form and recognition processing.
class ExampleRule(CompoundRule):
spec = "do something computer" # Spoken form of command.
def _process_recognition(self, node, extras): # Callback when command is spoken.
print "Voice command spoken."
# Create a grammar which contains and loads the command rule.
grammar = Grammar("example grammar") # Create a grammar to contain the command rule.
grammar.add_rule(ExampleRule()) # Add the command rule to the grammar.
grammar.load() # Load the grammar.
后面应该跟
import time
import pythoncom
while True:
pythoncom.PumpWaitingMessages()
time.sleep(.1)
正如这里提到的 - http://dragonfly.googlecode.com/svn-history/r46/trunk/dragonfly/examples/dragonfly-main.py
【讨论】: