title: c++ sndPlaySound skip to 10 seconds
body: <p>I'm searching now for hours and I hope you can help me. </p>
  
  <p>I am programming an musicplayer which reads an *.wav File via ifstream to an buffer and then i play the sound via sndPlaysound(). That works but now I want to pause the played song and then continue later and I want to know if anybody has any suggestions how I can skip to e.g. 10 seconds in the wav file so that I'm not starting at the beginning again.</p>
  
  <p>Here is the code of the things I did until now:</p>
  
  <pre><code>#pragma comment(lib,"winmm.lib")
  #include &lt;windows.h&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  Wave::Wave(char * filename)
  {
      buffer = 0;
  
      std::ifstream infile(filename, std::ios::binary);
  
      /*here is some irrelevant code I omitted*/
  
      infile.seekg(0, std::ios::end);  //move to end
      int length = infile.tellg();   //
      buffer = new char[length];    //allocate memory
      infile.seekg(0, std::ios::beg);   //move to start
      infile.read(buffer, length); //save in buffer
  
      totalTime = (length - 44) / bytesPerSec; //total time of *.wav
  
      infile.close();
  }
  
  void Wave::play(bool async)
  {
      if (async)
          sndPlaySound((LPCTSTR)buffer,  SND_MEMORY | SND_ASYNC);
      else
          sndPlaySound((LPCTSTR)buffer,  SND_MEMORY);
  }
  </code></pre>
  
  <p>and I am searching for any ideas how to make a method like this</p>
  
  <pre><code>Wave::play(bool async, int x)
  {
       /*start playing *.wav at x seconds*/
  }
  </code></pre>
  
  <p>Thanks for every answer or idea</p>