# AudioDataFormat

    class AudioDataFormat: NSObject

Wraps properties describing the format of the incoming audio samples, namely number of channels and the sample rate.
- `
  ### [init(channelCount:sampleRate:)](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Classes/AudioDataFormat.md.txt#/c:objc(cs)MPPAudioDataFormat(im)initWithChannelCount:sampleRate:)

  ` Initializes a new `AudioDataFormat` with the given channel count and sample rate.

  #### Declaration

  Swift

      init(channelCount: UInt, sampleRate: Double)

  #### Parameters

  |---|---|
  | `channelCount` | Number of channels. |
  | `sampleRate` | Sample rate. |

  #### Return Value

  A new instance of `AudioDataFormat` with the given channel count and sample rate.
- `
  ### [init(sampleRate:)](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Classes/AudioDataFormat.md.txt#/c:objc(cs)MPPAudioDataFormat(im)initWithSampleRate:)

  ` Initializes a new `AudioDataFormat` with the default channel count of 1 and the given sample rate.

  #### Declaration

  Swift

      init(sampleRate: Double)

  #### Parameters

  |---|---|
  | `sampleRate` | Sample rate. |

  #### Return Value

  A new instance of `AudioDataFormat` with the default channel count of 1 and the given sample rate.
- `
  ### [channelCount](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Classes/AudioDataFormat.md.txt#/c:objc(cs)MPPAudioDataFormat(py)channelCount)

  ` Number of channels

  #### Declaration

  Swift

      var channelCount: UInt { get }

- `
  ### [sampleRate](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Classes/AudioDataFormat.md.txt#/c:objc(cs)MPPAudioDataFormat(py)sampleRate)

  ` Sample rate

  #### Declaration

  Swift

      var sampleRate: Double { get }