title: OSError: No Default Input Device Available
body: <p>I am trying speech recognition with SpeechRecognition package in python and facing problem when trying to work with microphone.</p>
  
  <p>I tested Microphone of my earphones , it is working fine and is being detected by my computer but my script is throwing error as if there is no mic connected.
  When I run the following script after installing pyAudio</p>
  
  <pre><code>$python -m speech_recognition
  </code></pre>
  
  <p>I get following error:</p>
  
  <pre><code>  Traceback (most recent call last):
  
     File "/home/harshita/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
          "__main__", mod_spec)
  
      File "/home/harshita/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
          exec(code, run_globals)
  
      File "/home/harshita/anaconda3/lib/python3.6/site-packages/speech_recognition/__main__.py", line 4, in &lt;module&gt;
          m = sr.Microphone()
  
      File "/home/harshita/anaconda3/lib/python3.6/site-packages/speech_recognition/__init__.py", line 86, in __init__
          device_info = audio.get_device_info_by_index(device_index) if device_index is not None else audio.get_default_input_device_info()
  
      File "/home/harshita/anaconda3/lib/python3.6/site-packages/pyaudio.py", line 949, in get_default_input_device_info
          device_index = pa.get_default_input_device()
  
      OSError: No Default Input Device Available
  </code></pre>
  
  <p>And also:</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>import speech_recognition as sr</p>
        
        <p>sr.Microphone.list_microphone_names()</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>output:
  [ ]</p>
  
  <p>Where is it that I am going wrong?</p>
  
  <p>Also why is it showing 'OSError'?, I saw other related queries but all of them had it as IOError.</p>