title: How can I do real-time voice activity detection in Python?
body: <p>I am performing a voice activity detection on the recorded audio file to detect speech vs non-speech portions in the waveform.</p>
  
  <p>The output of the classifier looks like (highlighted green regions indicate speech):</p>
  
  <p><a href="https://i.stack.imgur.com/q4E6R.png" rel="noreferrer"><img src="https://i.stack.imgur.com/q4E6R.png" alt="enter image description here"></a></p>
  
  <p>The only issue I face here is making it work for a stream of audio input (for eg: from a microphone) and do real-time analysis for a stipulated time-frame.</p>
  
  <p>I know <code>PyAudio</code> can be used to record speech from the microphone dynamically and there a couple of real-time visualization examples of a waveform, spectrum, spectrogram, etc, but could not find anything relevant to carrying out feature extraction in a near real-time manner.  </p>