Code not returning response to command
Question: Quick question: I'm using the Speech Python Module for voice recognition.
Here's the code I have so far,

    
    
    import speech
    import time
    
    
    def callback(phrase, listener):
        if listener == "hello":
            print "Hello sir."
            listener.stoplistening()
    
    listener = speech.listenforanything(callback)
    while listener.islistening():
        time.sleep(.5)
    

But it never prints "Hello sir." I'm wondering if I'm doing something wrong.
I've looked online, but there's not much documentation. Can anyone help?

Ps: I'm using a Windows 8 laptop 64-bit and Python 2.7.


Answer: Try this:

    
    
    import speech
    import time
    
    
    def callback(phrase, listener):
        # I have used phrase is here
        if phrase == "hello":
            print "Hello sir."
            listener.stoplistening()
    
    listener = speech.listenforanything(callback)
    while listener.islistening():
        time.sleep(.5)
    

