AKClipRecorder

  • Initialize a recorder with a node.

    Declaration

    Swift

    public init(node: AKOutput)

    Parameters

    node

    The node that audio will be recorded from

  • Starts the internal timeline.

    Declaration

    Swift

    open func play()
  • Starts the internal timeline from audioTime.

    Declaration

    Swift

    open func play(at audioTime: AVAudioTime?)

    Parameters

    audioTime

    An time in the audio render context.

  • The current time of the internal timeline. Setting will call stop().

    Declaration

    Swift

    open var currentTime: Double
  • Stops internal timeline and finalizes any clips that are recording.

    Will stop immediately, clips may finish recording after stop returns.

    Declaration

    Swift

    open func stop(_ completion: (() -> Void)? = nil)

    Parameters

    completion

    a closure that will be called after all clips have benn finalized.

  • Sets recording end time for any recording clips.

    Playback continues. If clips have an endTime less than endTime, they will be unaffected.

    Declaration

    Swift

    open func stopRecording(endTime: Double? = nil, _ completion: (() -> Void)? = nil)
  • Is inner timeline playing.

    Declaration

    Swift

    open var isPlaying: Bool
  • True if there are any clips recording.

    Declaration

    Swift

    open var isRecording: Bool
  • Schedule an audio clip to record.

    Clips are recorded to an audio file in the tmp directory, they are accessed when the completeion block is called, if no error.

    Declaration

    Swift

    public func recordClip(time: Double = 0,
                               duration: Double = Double.greatestFiniteMagnitude,
                               tap: AVAudioNodeTapBlock? = nil,
                               completion: @escaping AKRecordingResult) throws