Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as unsolved with 2 replies, 0 views
Replied In
synchronizing audio recording to playback
how do I synchronize playback to AVAudioRecorder start record time? Can I assume AVAudioRecorder uses the clock from CMClockGetHostTimeClock?
CMTime referenceTime = CMTimeAdd(CMClockGetTime(self.player.masterClock), CMTimeMakeWithSeconds(2, NSECPERSEC)); //start playback and record 2 seconds after.
[self.player setRate:1.0 time:kCMTimeZero atHostTime:referenceTime];
CMTime syncPTS = CMSyncConvertTime(referenceTime, self.player.masterClock, CMClockGetHostTimeClock());
[self.audioRecorder recordAtTime:CMTimeGetSeconds(syncPTS) forDuration:30]; //audioRecorder is an instance of AVAudioRecorder