title: How to make a python script listen continuously in the background without raising an unknown value error
body: <p>I want to make a python script to run in the background continuously even if the user is not saying anything to it. Every time, when I try to do so, I get an unknown value error message. I  want the python script to listen continuously without giving any error. This the code that I am using:</p>
  
  <pre><code>import pyaudio 
  import speech_recognition as sr
  
  def callback(recognizer, audio):
  # received audio data, now we'll recognize it using Google Speech        Recognition
  try:
  
      print("Google Speech Recognition thinks you said " + recognizer.recognize_google(audio))
  except sr.UnknownValueError:
      print("Google Speech Recognition could not understand audio")
  except sr.RequestError as e:
      print("Could not request results from Google Speech Recognition service; {0}".format(e))
  
  r = sr.Recognizer()
  m = sr.Microphone()
  with m as source:
      r.adjust_for_ambient_noise(source) 
  
  stop_listening = r.listen_in_background(m, callback)
  
  import time
  for _ in range(100): time.sleep(0.1) 
  stop_listening() 
  print("over")
  while True: time.sleep(0.1) 
  </code></pre>