---
title: "init(sensitivityPoints:start:end:metadata:)"
framework: healthkit
role: symbol
role_heading: Initializer
path: "healthkit/hkaudiogramsample/init(sensitivitypoints:start:end:metadata:)"
---

# init(sensitivityPoints:start:end:metadata:)

Creates a new audiogram sample.

## Declaration

```swift
convenience init(sensitivityPoints: [HKAudiogramSensitivityPoint], start startDate: Date, end endDate: Date, metadata: [String : Any]?)
```

## Parameters

- `sensitivityPoints`: An array of sensitivity points.
- `startDate`: The start date for the sample. This date must be equal to or earlier than the end date; otherwise, this method throws an exception (doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException).
- `endDate`: The end date for the sample. This date must be equal to or later than the start date; otherwise, this method throws an exception (doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException).
- `metadata`: The metadata dictionary contains extra information describing this sample. The dictionary’s keys are strings. The values may be strings, numbers, or dates. For a complete list of predefined metadata keys, see doc://com.apple.healthkit/documentation/HealthKit/metadata-keys. Using predefined keys helps facilitate sharing data between apps; however, you are also encouraged to create your own, custom keys as needed to extend the HealthKit quantity sample’s capabilities.
