title: C++ audio output
body: <p>I would like to output an audio stream (asynchronously) in C++.</p>
  
  <p>I have already looked <a href="https://stackoverflow.com/questions/5738603/c-specific-sound-output">here</a>,<a href="https://stackoverflow.com/questions/21362045/simple-c-win-console-program-for-audio-output">here</a>, and <a href="https://stackoverflow.com/questions/1565439/how-to-playsound-in-c-using-windows-api">here</a> but it is obsolete and the link is broken.</p>
  
  <p>I am sure this is a simple task, yet I can't find anywhere on the web to do it. I prefer something neat and tidy, STL oriented (e.g. device I can write to like I am writing to the screeen?). As I am using VC2013, I can use windows precompiled headers but prefer to avoid it.</p>
  
  <p>Thanks,</p>
  
  <p>UPDATE:</p>
  
  <p>I was trying to stay close to STL, but by the look of it, I can't, so I'll stick with windows API.
  PlaySound is inappropriate because my data is not on file, it is in a buffer in he memory.
  I have tried using <code>waveOutWrite</code> but I would like to play two sound sequentially, i.e at t=0 start a sound for 2 sec, and at t=1 start a sound for 3 sec (overlap)</p>