record(atTime:)
Records audio starting at a specific time.
Declaration
func record(atTime time: TimeInterval) -> BoolParameters
- time:
The time at which to start recording, relative to Devicecurrenttime.
Return Value
Discussion
You can call this method on a single recorder, or use it to synchronize the recording of multiple players as shown below.
func startSynchronizedRecording() {
// Create a time offset relative to the current device time.
let timeOffset = recorderOne.deviceCurrentTime + 0.01
// Synchronize the recording time of both recorders.
recorderOne.record(atTime: timeOffset)
recorderTwo.record(atTime: timeOffset)
}Calling this method implicitly calls prepareToRecord(), which creates an audio file and prepares the system for recording.