【问题标题】:Speech processing library in Python for speech to textPython 中的语音处理库,用于将语音转换为文本
【发布时间】:2011-02-02 11:37:04
【问题描述】:

嘿嘿 我正在寻找在 python 中构建一个代码,它将识别我通过麦克风说话并转换为语音, 你能给我几个高效的语音处理库来实现同样的目标吗?

【问题讨论】:

    标签: python speech-recognition


    【解决方案1】:
    【解决方案2】:

    蜻蜓示例代码在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

    【讨论】:

      猜你喜欢
      • 2023-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多