iPhone - why does AVAudioPlayer currentTime return a negative value?

Posted by lostInTransit on Stack Overflow See other posts from Stack Overflow or by lostInTransit
Published on 2009-11-17T08:51:36Z Indexed on 2010/03/30 22:53 UTC
Read the original article Hit count: 321

Filed under:
|
|

Hi

When does the AVAudioPlayer's currentTime method return a negative value? The audio file is playing (I am putting in a check before getting currentTime) but making a call to currentTime returns a negative value.

Any ideas? Thanks

if(thePlayer != nil && [thePlayer isPlaying]){
    double playerTime = [thePlayer currentTime];
    NSLog(@"Player Time: %f", playerTime);
}

Output

Player Time: -0.019683

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk