@@ -0,0 +1,1165 @@
+import os                             # NOTE: this requires PyAudio because it uses the Microphone class%0Aimport speech_recognition as sr%0Aimport re%0A%0A%0Aos.system(%22afplay /System/Library/Sounds/Ping.aiff%22)%0Ar = sr.Recognizer()%0Awith sr.Microphone() as source:                # use the default microphone as the audio source%0A    r.adjust_for_ambient_noise(source)         # listen for 1 second to calibrate the energy threshold for ambient noise levels%0A    audio = r.listen(source)                   # now when we listen, the energy threshold is already set to a good value, and we can reliably catch speech right away%0A%0A%0Atry:%0A    print(%22You said %22 + r.recognize(audio))    # recognize speech using Google Speech Recognition%0A    os.system(%22afplay /System/Library/Sounds/Submarine.aiff%22)%0A    responseObj = re.search('yes', r.recognize(audio), re.M%7Cre.I)%0A    if responseObj:%0A    %09os.system(%22python mic.py%22)%0A    else:%0A    %09os.system(%22say ok%22)%0Aexcept LookupError:                            # speech is unintelligible%0A    print(%22Could not understand audio%22)%0A    os.system(%22say Could not understand audio%22)%0A    os.system(%22say Can i try again?%22)%0A    os.system(%22python yesNo.py%22)%0A

Create yesNo.py