MediaPipeTasksRetrieval Framework Reference

AudioPart

class AudioPart: TaskPart

Audio part representing the audio content block of a multi-modal block.

  • Initializes a new MPPAudioPart using in-memory audio buffer data.

    Declaration

    Swift

    convenience init(data: Data)

    Parameters

    data

    The raw audio data bytes.

    Return Value

    An instance of MPPAudioPart configured with in-memory data.

  • Initializes a new MPPAudioPart using a path or resource handle.

    Declaration

    Swift

    convenience init(filePath: String)

    Parameters

    filePath

    The path or resource handle for the audio.

    Return Value

    An instance of MPPAudioPart configured with the file path.

  • Initializes a new MPPAudioPart with both a resource handle and transient in-memory audio data.

    Declaration

    Swift

    init(filePath: String?, data: Data?)

    Parameters

    filePath

    The optional path or resource identifier handle to persist in storage.

    data

    The optional raw audio data bytes to use for in-memory embedding.

    Return Value

    An instance of MPPAudioPart.

  • The raw in-memory audio buffer, if initialized with data. Nil if initialized from a file path alone or deserialized from persistent storage.

    Declaration

    Swift

    var data: Data? { get }
  • The filesystem path or resource identifier handle (e.g., asset URI) for the audio. May be provided alongside in-memory data to persist a lightweight handle while embedding from memory.

    Declaration

    Swift

    var filePath: String? { get }