title: How do I make my speech_recognition pause threshold work correctly
body: <p>I am trying to take audio input and save it as .wav file.<br />
  My code is the following:</p>
  <pre><code>import speech_recognition as sr
  def save():
      r=sr.Recognizer()
      r.pause_threshold = 0.6
      with sr.Microphone() as source:
          print('Yes')
          
          audio=r.listen(source)
      with open('test.wav','wb') as wav:
           wav.write(audio.get_wav_data())
  save()
  </code></pre>
  <p>If I save and run this file it listens forever or till I terminate the code.<br />
  Can anybody help me.<br />
  Thank you<br />
  -<em><strong>Levers</strong></em></p>