MediaPipeTasksCommon Framework Reference

AudioData

final class AudioData

Stores input audio samples in a circular buffer.

  • Creates a zero-initialized buffer with capacity for sampleCount frames per channel.

    Declaration

    Swift

    init(format: AudioDataFormat, sampleCount: Int)
  • Snapshot of all internal buffer elements in chronological order (most recent at the end).

    Declaration

    Swift

    final var buffer: FloatBuffer { get }
  • Capacity in number of multi-channel sample frames.

    Declaration

    Swift

    final var bufferLength: Int { get }
  • Declaration

    Swift

    final let format: AudioDataFormat
  • Loads the latest samples from audioRecord.

    Declaration

    Swift

    final func load(audioRecord: AudioRecord) throws
  • Loads a slice of interleaved audio samples from buffer into the internal ring buffer.

    Declaration

    Swift

    final func load(buffer: FloatBuffer, offset: Int, length: Int) throws