问题描述
嘿,我正在寻找在python中构建一个代码,它将识别我通过micrphone讲话并转换为语音,你能不能给我几个高效的语音处理库来达到同样的目的?
1楼
请参阅
其中涉及 。 您可能还想查看
2楼
蜻蜓示例代码错过了一个片段,同时在提供代码示例
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)
如上所述 -