title: Python speech to text using speechrecognition
body: <p>I am making a software which uses speech to text. I have read some article and post on stackoverflow. I tried this code-</p>
  
  <pre><code>r = sr.Recognizer()
  with sr.Microphone(device_index=1) as source:
      r.adjust_for_ambient_noise(source)
      print("Speak:")
      audio = r.listen(source)
  
  try:
      print("You said " + r.recognize_google(audio)+';')
  except sr.UnknownValueError:
      print("Could not understand audio")
  except sr.RequestError as e:
      print("Could not request results; {0}".format(e))
  </code></pre>
  
  <p>After I run the code when it reaches this part it makes the input phase and stops. It does nothing and tkinter window Doesn't respond. It looks like this.<a href="https://i.stack.imgur.com/XUkFs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XUkFs.png" alt="enter image description here"></a></p>
  
  <p>I tried both <code>r.recognize_google</code> and <code>r.recognize_sphinx</code>. I also tried not using microphone index. I can't understand what is happenning. When it comes to <code>r.listen(source)</code> it stops. Thanks for your advice.</p>