AKNodeRecorder

open class AKNodeRecorder : NSObject

Simple audio recorder class

  • Declaration

    Swift

    public private(set) var node: AKNode?
  • True if we are recording.

    Declaration

    Swift

    @objc
    public private(set) dynamic var isRecording: Bool
  • An optional duration for the recording to auto-stop when reached

    Declaration

    Swift

    open var durationToRecord: Double
  • Duration of recording

    Declaration

    Swift

    open var recordedDuration: Double { get }
  • If non-nil, attempts to apply this as the format of the specified output bus. This should only be done when attaching to an output bus which is not connected to another node; an error will result otherwise. The tap and connection formats (if non-nil) on the specified bus should be identical. Otherwise, the latter operation will override any previously set format.

    Default is nil.

    Declaration

    Swift

    open var recordFormat: AVAudioFormat?
  • return the AKAudioFile for reading

    Declaration

    Swift

    open var audioFile: AKAudioFile? { get }
  • Initialize the node recorder

    Recording buffer size is defaulted to be AKSettings.bufferLength You can set a different value by setting an AKSettings.recordingBufferLength

    Declaration

    Swift

    public init(node: AKNode? = AudioKit.output,
                file: AKAudioFile? = nil,
                bus: Int = 0) throws

    Parameters

    node

    Node to record from

    file

    Audio file to record to

  • Start recording

    Declaration

    Swift

    @objc
    open func record() throws
  • Stop recording

    Declaration

    Swift

    @objc
    open func stop()
  • Reset the AKAudioFile to clear previous recordings

    Declaration

    Swift

    open func reset() throws