AKDiskStreamer

open class AKDiskStreamer : AKNode, AKComponent

Audio player that loads a sample into memory

  • Declaration

    Swift

    public typealias AKAudioUnitType = AKDiskStreamerAudioUnit
  • Four letter unique description of the node

    Declaration

    Swift

    public static let ComponentDescription: AudioComponentDescription
  • Ramp Duration represents the speed at which parameters are allowed to change

    Declaration

    Swift

    @objc
    open dynamic var rampDuration: Double { get set }
  • Volume - amplitude adjustment

    Declaration

    Swift

    @objc
    open dynamic var volume: Double { get set }
  • Loop Enabled - if enabled, the sample will loop back to the startpoint when the endpoint is reached. When disabled, the sample will play through once from startPoint to endPoint

    Declaration

    Swift

    @objc
    open dynamic var loopEnabled: Bool { get set }
  • Number of samples in the audio stored in memory

    Declaration

    Swift

    open var size: Sample { get }
  • originalSampleRate

    Declaration

    Swift

    open var originalSampleRate: Double? { get }
  • Position in the audio file from 0 - 1

    Declaration

    Swift

    open var normalizedPosition: Double { get }
  • Position in the audio in samples, but represented as a double since you could conceivably be at a non-integer sample

    Declaration

    Swift

    open var position: Double { get }
  • Tells whether the node is processing (ie. started, playing, or active)

    Declaration

    Swift

    @objc
    open dynamic var isStarted: Bool { get }
  • Declaration

    Swift

    open var loadCompletionHandler: AKCallback { get set }
  • Declaration

    Swift

    open var completionHandler: AKCallback { get set }
  • Initialize this SamplePlayer node

    Declaration

    Swift

    @objc
    public init(volume: Double = 1,
                completionHandler: @escaping AKCCallback = {},
                loadCompletionHandler: @escaping AKCCallback = {})

    Parameters

    volume

    Multiplication factor of the overall amplitude (Default: 1)

    completionHandler

    Callback to run when the sample playback is completed

    loadCompletionHandler

    Callback to run when the sample is loaded

  • Function to start, play, or activate the node, all do the same thing

    Declaration

    Swift

    @objc
    open func start()
  • Function to stop or bypass the node, both are equivalent

    Declaration

    Swift

    @objc
    open func stop()
  • Play from a certain sample

    Declaration

    Swift

    open func play()
  • Load a new audio file into memory - this must be done after audiokit starts

    Declaration

    Swift

    open func load(file: AKAudioFile)