语音识别扩展库
dragonfl的Python项目详细描述
蜻蜓提供了强大的python语音接口 识别与高级语言对象模型 创建和使用语音命令。蜻蜓支持跟随 语音识别引擎:
- Dragon NaturallySpeaking (DNS), a product of Nuance
- Windows Speech Recognition (WSR), included with Microsoft Windows Vista and freely available for Windows XP
基本示例
使用蜻蜓的一个非常简单的例子是创建一个 带有回调的语音命令,当 命令是口头的。操作如下:
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.
上面的例子非常基本,没有显示任何 蜻蜓令人兴奋的特性,如动态的语音元素。 要了解更多关于这些的信息,请查看项目的 文档here。