Библиотека обработки речи в Python для речи в текст - PullRequest
7 голосов
/ 02 февраля 2011

Эй, я собираюсь создать код на python, который распознает то, что я говорю через микрофон, и преобразую в речь. Не могли бы вы дать мне несколько эффективных библиотек для обработки речи для достижения того же значения?

Ответы [ 2 ]

4 голосов
/ 02 февраля 2011
0 голосов
/ 02 апреля 2014

Пример кода стрекозы отсутствует в фрагменте, при этом приведенный пример кода https://pythonhosted.org/dragonfly/

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

...