AKClipRecorder

open class AKClipRecorder
  • Declaration

    Swift

    open var node: AKOutput
  • Initialize a recorder with a node.

    Declaration

    Swift

    @objc
    public init(node: AKOutput)

    Parameters

    node

    The node that audio will be recorded from

  • Starts the internal timeline.

    Declaration

    Swift

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

    Declaration

    Swift

    open func start(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 { get set }
  • 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)
  • True if there are any clips recording.

    Declaration

    Swift

    open var isRecording: Bool { get }
  • 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 ClipRecordingCompletion) throws
  • Declaration

    Swift

    public var isStarted: Bool { get }
  • Declaration

    Swift

    public func stop()
  • Declaration

    Swift

    public func setPosition(_ position: Double)
  • Declaration

    Swift

    public func position(at audioTime: AVAudioTime?) -> Double
  • Declaration

    Swift

    public func audioTime(at position: Double) -> AVAudioTime?