# AudioPart

    class AudioPart: TaskPart

Audio part representing the audio content block of a multi-modal block.
- `
  ### [init(data:)](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/AudioPart.md.txt#/c:objc(cs)MPPAudioPart(im)initWithData:)

  ` 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.
- `
  ### [init(filePath:)](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/AudioPart.md.txt#/c:objc(cs)MPPAudioPart(im)initWithFilePath:)

  ` 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.
- `
  ### [init(filePath:data:)](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/AudioPart.md.txt#/c:objc(cs)MPPAudioPart(im)initWithFilePath:data:)

  ` 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`.
- `
  ### [data](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/AudioPart.md.txt#/c:objc(cs)MPPAudioPart(py)data)

  ` 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 }

- `
  ### [filePath](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/AudioPart.md.txt#/c:objc(cs)MPPAudioPart(py)filePath)

  ` 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 }