title: I have an unintended delay in playing a Mix_Chunk
body: <p>So I am trying to learn SDL and creating a small game. When the user presses the space bar, it should play a sound. This works, but the sound takes about .5 seconds to play... How would I fix this? I've checked the actual file to see if the delay was just part of it, and that turned out to not be the case.</p>
  
  <p>SDL with c++ on win vista.</p>
  
  <p>Here's some relevant code:</p>
  
  <pre><code>...
  Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 )
  ...
  
      main() 
      {
  
      ...
  
      Mix_PlayMusic( BG_Music, 0 );   //background music
  
          while( quit == false )
          {
              fps.start();
              fire.handleInput( event, ship.get_x_pos() );
      ...
      }
  </code></pre>
  
  <p>the handle input function:</p>
  
  <pre><code>void lasersC::handleInput( SDL_Event &amp;event, int x )
  {
      Uint8 *keystates = SDL_GetKeyState( NULL );
  
      if ( keystates[ SDLK_SPACE ] &amp;&amp; delay == 0)
      {
          Mix_PlayChannel(-1, laser, 0);
          fired * F = new fired( NULL, S_HEIGHT - 50, x + 20 );
  
          F-&gt;shot  = lasers;
          F-&gt;y_pos = S_HEIGHT - 50;
          F-&gt;x_pos = x + 20;
  
          weps.push_back( F );
          delay = 10;
      }
  }
  </code></pre>
  
  <p>If more is needed, let me know.</p>