<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SoundAnalysis",
  "identifier" : "/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Sound Analysis"
    ],
    "preciseIdentifier" : "c:objc(cs)SNTimeDurationConstraint"
  },
  "title" : "SNTimeDurationConstraint"
}
-->

# SNTimeDurationConstraint

Defines the time duration windows the request’s underlying sound classifier accepts with a range, or an array, of durations.

```
@interface SNTimeDurationConstraint : NSObject
```

## Overview

Inspect the constraint’s [`type`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/type) property first to determine whether to check [`durationRange`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/durationRange) or [`enumeratedDurations`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/enumeratedDurations) next.

## Topics

### Inspecting a Constraint

[`type`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/type)

An enumeration that tells you which constraint property to inspect.

[`SNTimeDurationConstraintType`](/documentation/SoundAnalysis/SNTimeDurationConstraintType)

Defines the types a time duration constraint uses.

[`durationRange`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/durationRange)

A time duration range the request’s underlying sound classifier accepts.

[`enumeratedDurations`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/enumeratedDurations)

An array of time durations the request’s underlying sound classifier accepts.

### Creating a Time Duration Constraint

[`-  initWithDurationRange:`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/initWithDurationRange:)

Creates a constraint with a time duration range.

[`-  initWithEnumeratedDurations:`](/documentation/SoundAnalysis/SNTimeDurationConstraint-c.class/initWithEnumeratedDurations:)

Creates a constraint with discrete time durations.

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)