title: fmod: How to use FMOD_OUTPUTTYPE_WAVWRITER_NRT?
body: <p>this is a follow up to my earlier question: <a href="https://stackoverflow.com/questions/5938972/rendering-some-sound-data-into-one-new-sound-data">Rendering some sound data into one new sound data?</a></p>
  
  <p>I'm creating a program that will process a file containing a sound bank and time offsets to mark when the sound must be played and generate a wave file from it.</p>
  
  <p>So I suppose FMOD_OUTPUTTYPE_WAVWRITER is perfect for the job.</p>
  
  <p>For the sound bank, imagine something like this in a file:</p>
  
  <pre><code>0 kick.wav
  1 hit.wav
  2 flute.wav
  </code></pre>
  
  <p>where the number on the left describes the sound ID of the sound file name on the right,
  and the time offsets:</p>
  
  <pre><code>1000 0
  2000 1
  3000 2
  </code></pre>
  
  <p>where the number on the left tells the program when the sound must be played in milliseconds, and number on the right is the sound ID.</p>
  
  <p>Therefore, when I start the program, FMOD will generate a wave file which contains a kick (from kick.wav) in the first second, a hit in the second second, and a flute in the third second, and I will have to wait for at least 3 seconds for the task to complete.</p>
  
  <p>However, if I want to render a longer music, say, 5 minutes, then I must have to wait for at least 5 minutes for the task to complete, since I make it depend on the system timer to play the sound at the specified offset in the file and a while(true) loop to update FMOD::System. I think there must be a way to render faster without waiting for the program to actually render the sound at the specified time, since I saw in a DAW program like, say, Sony ACID, can render the tracks really fast.</p>
  
  <p>Then I take a bit look into the API reference, there's FMOD_OUTPUTTYPE_WAVWRITER_NRT, then I thought this maybe the solution, so I tried changing the output device right away without modifying anything else, and the generated wave file sounds messed up! I hear many repetitive sound, long delays, etc.</p>
  
  <p><strong>So, how to use the non-realtime version properly? What is the correct way to update the fmod system when using NRT in my case?</strong></p>
  
  <p>I couldn't find a clear explanation about the usage of NRT ouput type in the fmod documentation itself.</p>
  
  <p>Anyway, I use C++ in a Windows environment.</p>
  
  <p>Thanks.</p>