当前位置: 代码迷 >> python >> Python语音处理库,用于语音到文本
  详细解决方案

Python语音处理库,用于语音到文本

热度:74   发布时间:2023-07-16 10:38:53.0

嘿,我正在寻找在python中构建一个代码,它将识别我通过micrphone讲话并转换为语音,你能不能给我几个高效的语音处理库来达到同样的目的?

请参阅

其中涉及 。 您可能还想查看

蜻蜓示例代码错过了一个片段,同时在提供代码示例

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)

如上所述 -