title: CocosDenshion: why isPlaying always false (I can hear the music)?
body: <p>I have this:</p>
  
  <pre><code>-(ALuint)ID
  { return self.soundSource-&gt;_sourceId; }
  
  -(void)play
  {
      [self.engine playSound:self.soundSource.soundId
               sourceGroupId:0
                       pitch:self.pitch
                         pan:1.0
                        gain:1.0
                        loop:NO];
  }
  
  -(NSTimeInterval)duration
  { return durationOfSourceId(self.ID); }
  
  -(NSTimeInterval)offset
  { return elapsedTimeOfSourceId(self.ID); }
  
  -(BOOL)isPlaying
  {
      NSTimeInterval secondsRemaining = self.duration - self.offset;
      NSLog(@"&lt;%.3f&gt;", self.soundSource.durationInSeconds);
      NSLog(@"&lt;%.3f&gt; - &lt;%.3f&gt; = &lt;%.3f&gt; isPlaying &lt;%i&gt;", self.duration, self.offset, secondsRemaining, self.soundSource.isPlaying);
      return (secondsRemaining &gt; 0.0);
  }
  
  
  #pragma mark - OpenAL addons
  
  static NSTimeInterval elapsedTimeOfSourceId(ALuint sourceID)
  {
      float result = 0.0;
      alGetSourcef(sourceID, AL_SEC_OFFSET, &amp;result);
      return result;
  }
  
  static NSTimeInterval durationOfSourceId(ALuint sourceID)
  {
      //Thanks to http://stackoverflow.com/a/8822347
  
      ALint bufferID, bufferSize, frequency, bitsPerSample, channels;
      alGetSourcei(sourceID, AL_BUFFER, &amp;bufferID);
      alGetBufferi(bufferID, AL_SIZE, &amp;bufferSize);
      alGetBufferi(bufferID, AL_FREQUENCY, &amp;frequency);
      alGetBufferi(bufferID, AL_CHANNELS, &amp;channels);
      alGetBufferi(bufferID, AL_BITS, &amp;bitsPerSample);
      NSTimeInterval result = ((double)bufferSize)/(frequency*channels*(bitsPerSample/8));
      return result;
  }
  </code></pre>
  
  <p>Where engine is just an instance of CDSoundEngine. I really want to know when will the music stop. I'm into it for a whole day now, and I'm tired.</p>
  
  <p>It logs:
  [1445:707] &lt;1.656>
  [1445:707] &lt;1.656> - &lt;0.000> = &lt;1.656> isPlaying &lt;0> </p>
  
  <p>So the OpenAL source ID is right (since I can get the duration).
  The CDSoundSource is also right (since I can get the duration from that as well).
  I can hear the sound playing.</p>
  
  <p>But AL_SEC_OFFSET is always 0.0, isPlaying is always NO.</p>