title: Audio looping in Objective-C/iPhone
body: <p>So, I'm finishing up an iPhone App.</p>
  
  <p>I have the following code in place to play the file:</p>
  
  <pre><code>while(![player isPlaying]) {
    totalSoundDuration = soundDuration + 0.5; //Gives a half second break between sounds
    sleep(totalSoundDuration); //Don't play next sound until the previous sound has finished
    [player play]; //Play sound
    NSLog(@" \n Sound Finished Playing \n"); //Output to console
  }
  </code></pre>
  
  <p>For some reason, the sound plays once then the code loops and it outputs the following:</p>
  
  <pre><code>Sound Finished Playing
  Sound Finished Playing
  Sound Finished Playing
  etc...
  </code></pre>
  
  <p>This just repeats forever, I don't suppose any of you lovely people can fathom what could be the boggle?</p>
  
  <p>Cheers!</p>