def _process_recognition(self, node, extras):
    print('Voice command spoken.')
grammar = Grammar('example grammar')
grammar.add_rule(ExampleRule())
grammar.load()
Speech processing library in Python for speech to text