tags:

views:

15

answers:

1

I used an AVAudioPlayer object to control playing multiple music files. I also created an UISlider to control seeking file. But i have a problem when seek the pointer. After seeking, AVAudioPlayer update time correct then jump into "audioPlayerDidFinishPlaying" function unexpected. Here is the code that i used :

-(void)timeChange

{ _player.currentTime = _timeControl.value; [self updateCurrentTimeForPlayer]; }

-(void)updateCurrentTimeForPlayer

{ if(_isNeedUpdate == NO) return; _timeControl.maximumValue = _player.duration; }

A: 

A long shot, but maybe the audio format doesn't support seeking?

Why the call to updateCurrentTimeForPlayer? Where is _isNeedUpdate set? (Why all the underscores?)

Can you add some debug NSLogs to find out what's going on?

tc.