title: Background music in c++
body: <p>When playing a wave file in c++, the program no longer executes anything else. Normally you would have to wait for the track to finish then the program would continue, but I'm playing a looping track and I need it to play while the program executes. Is there a way to do this? Thanks.</p>
  
  <pre><code>PlaySound("sleep_away.wav", NULL, SND_FILENAME|SND_LOOP);
  
  cout &lt;&lt; "x1" &lt;&lt; endl;
  cin &gt;&gt; x1;
  
  cout &lt;&lt; "y1" &lt;&lt; endl;
  cin &gt;&gt; y1;
  
  cout &lt;&lt; "x2" &lt;&lt; endl;
  cin &gt;&gt; x2;
  
  cout &lt;&lt; "y2" &lt;&lt; endl;
  cin &gt;&gt; y2;
  
  double f = slope (x1,y1,x2,y2);
  
  cout &lt;&lt; "y = " &lt;&lt; m &lt;&lt; "x + " &lt;&lt; yi &lt;&lt; endl;
  </code></pre>