从蜻蜓语音识别引擎获取文本
get text from dragonfly speech recogtion engine
我想获取语音识别引擎蜻蜓识别的文本,并使用 python 获取文本。已尝试使用 natlink,但我想制作一个基于服务器的应用程序并仅识别文本
您将不得不使用 Natlink 或 Windows 语音识别。没有识别引擎就无法识别文本。如果您想获得完整的可识别文本,请使用 Dictation 元素创建一个命令,其中不包含任何其他元素。将它映射到一个 Function 操作,该操作对结果做任何你想做的事情。像这样:
def myfunction(mycommand):
mycommand = str(mycommand)
'''do something ... '''
class MyRule(MappingRule):
mapping = {
"<mycommand>": Function(myfunction)
}
extras = [ Dictation("mycommand") ]
defaults = {"mycommand": None}
我想获取语音识别引擎蜻蜓识别的文本,并使用 python 获取文本。已尝试使用 natlink,但我想制作一个基于服务器的应用程序并仅识别文本
您将不得不使用 Natlink 或 Windows 语音识别。没有识别引擎就无法识别文本。如果您想获得完整的可识别文本,请使用 Dictation 元素创建一个命令,其中不包含任何其他元素。将它映射到一个 Function 操作,该操作对结果做任何你想做的事情。像这样:
def myfunction(mycommand):
mycommand = str(mycommand)
'''do something ... '''
class MyRule(MappingRule):
mapping = {
"<mycommand>": Function(myfunction)
}
extras = [ Dictation("mycommand") ]
defaults = {"mycommand": None}