title: jarvis ai building in python for windows
body: <p>from gtts import gTTS
  import os
  import speech_recognition as sr
  import webbrowser
  import time</p>
  
  <p>def talkToME(audioString):
      print(audioString)
      tts=gTTS(text=audioString, lang='en')
      tts.save('audio.mp3')
      os.system('mpg123 audio.mp3')</p>
  
  <h1>listens for commands</h1>
  
  <pre><code>def myCommand():
  
      r = sr.Recognizer()
  
      with sr.Microphone as source:
          print('Say Something!')
          r.pause_threshold = 1
          r.adjust_for_ambient_noise(source, duration =1)
          audio = r.listen(source)
  
  
      try:
          command = r.recognise_google(audio)
          print('you said: ' + command+ '/n')
  
          #loop back to continue listen for commands
  
      except sr.UnknownvalueError:
          assistant(myCommand())
  
          return command
  #if statements for executing commands
  
      def assistant(command):
  
          if "how are you" in command:
              talkToMe("i am fine")
  
  
  time.sleep(2)
  talkToMe(' hi brian, what can i do for you?')
  
  while True:
      command = recordAudio()
      assistant(myCommand())
  </code></pre>
  
  <p>this is my code. however, when i run it there is no error message and nothing seems to happen. i am kind of lost whats wrong. it was supposed to answer "I am fine" but nothing happens. i am using windows 10. and python 3.6.3 
  the code seems to be for linux. but i dont know why? and even if so how can edit or write a code for creating a simple jarvis for windows using python.
  thank you.</p>