MediaPipeTasksAudio Framework Reference

MPPFloatBuffer

class MPPFloatBuffer: NSObject, NSCopying

A wrapper class to store pointer to a float array and its size.

  • Initializes a new FloatBuffer by copying the elements of the given pointer to a float array. If data = NULL, all elements of the buffer are initialized to zero.

    Declaration

    Swift

    init(data: UnsafePointer<CFloat>?, length: UInt)

    Parameters

    data

    A pointer to a float array whose values are to be copied into the buffer.

    length

    Length of the float array.

    Return Value

    A new instance of FloatBuffer initialized with the elements of the given float array.

  • Initializes a FloatBuffer of the specified length with zeros.

    Declaration

    Swift

    init(length: UInt)

    Parameters

    length

    Number of elements the FloatBuffer can hold.

    Return Value

    A new instance of FloatBuffer of the given length and all elements initialized to zero.

  • Pointer to float array wrapped by FloatBuffer.

    Declaration

    Swift

    var data: UnsafeMutablePointer<CFloat> { get }
  • Capacity of the array in number of elements.

    Declaration

    Swift

    var length: UInt { get }
  • Clears the FloatBuffer by setting all elements to zero

    Declaration

    Swift

    func clear()