Skip to content Skip to sidebar Skip to footer

Speech Processing Library In Python For Speech To Text

Hey I am looking to build a code in python which will recognise what i speak through the micrphone and convert to speech, can you please give me few effcient speech processing lib

Solution 1:


Solution 2:

The dragonfly sample code misses out on a snippet while providing the code example at 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.

should be followed by

import time
import pythoncom
while True:
    pythoncom.PumpWaitingMessages()
    time.sleep(.1)

as mentioned here - http://dragonfly.googlecode.com/svn-history/r46/trunk/dragonfly/examples/dragonfly-main.py


Post a Comment for "Speech Processing Library In Python For Speech To Text"