title: Python - read audio stream
body: <p>So I'm trying to set up an app that records a audio input from a microphone, and checks to see if you say a specific phase/command. Once it reads that command, it then launches a function. I'm recording audio input using the sound device package. Actually to the docs you use the rec command to read in the input, but that is a start stop blocking operation. I cant evaluate the values of that recording. Does anyone know how to use a stream for the audio buffer ? </p>
  
  <pre><code>import sounddevice as sd
  import numpy as np
  
  fs = 44100
  duration = 5  # seconds
  myrecording = sd.rec(duration * fs, samplerate=fs, channels=2, dtype='float64')
  # I would like to read myrecording into a stream at this point. 
  print("Recording Audio")
  sd.wait()
  print("Audio recording complete , Play Audio")
  sd.play(myrecording, fs)
  sd.wait()
  print("Play Audio Complete")
  </code></pre>