Hi All, I am using MPMoviePlayerController and it is being used to play a silent movie(movie has no sound). The sound for the movie is played with AVAudioplayer in sync with the video, we have diferent audio file for each movie. Also user can record his voice while the movie and the audioplayer is running.Also i want the movie, audioplayer and audiorecorder to run in loop i.e. After each successful recording they loop to create another recording.
The recording should also be of exact duration as of the Video file, so I am using the recordForDuration:(NSTimeInterval)duration method of AVAudioRecorder, but the recorder fails to stop after that duration in 20 % takes. I am starting the recording when on MPMoviePlayerLoadStateDidChangeNotification notification, when load state == 3. I have implemented the AVAudioRecorderDelegate methods to check when it finishes recording. In some cases the recording finishes before MPMoviePlayerPlaybackDidFinishNotification and in other cases the MPMoviePlayerPlaybackDidFinishNotification arises first. I am not able to understand why the same piece of code generates different results. Also i have noticed that for eg: the duration of the recording is set to 9.765 seconds, and if MPMoviePlayerPlaybackDidFinishNotification arises first then the AudioRecorder currentTime property has value larger than the duration. Does anyone else had same kind of issue that AVAudioRecorder fails to stop after duration? Any help will be highly appreciated. Thanks in Advance..
Baljit Singh.