Contents

record(forDuration:)

Records audio for the indicated duration of time.

Declaration

func record(forDuration duration: TimeInterval) -> Bool

Parameters

  • duration:

    The duration of time to record, in seconds.

Return Value

true if successful; otherwise false.

Discussion

The recorder stops recording when it reaches the indicated duration.

Calling this method implicitly calls prepareToRecord(), which creates an audio file and prepares the system for recording.

See Also

Controlling recording