title: How do I open an audio output stream using sounddevice in python?
body: <p>I am trying to make my audio interface continuous play the same audio in a loop. Someone recommended the use of the "OutputStream" function in the sounddevice library. This is the code I wrote to do this:</p>
  
  <pre><code>sounddevice.default.device = "Focusrite USB ASIO, ASIO"
  sounddevice.default.samplerate = 48000
  stream = sounddevice.OutputStream()
  stream.start()
  stream.write(data)
  </code></pre>
  
  <p>The last line code is giving me the error:</p>
  
  <blockquote>
    <p>sounddevice.PortAudioError: Wait timed out [PaErrorCode -9987]</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>