<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SoundAnalysis",
  "identifier" : "/documentation/SoundAnalysis/SNClassifySoundRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Sound Analysis"
    ],
    "preciseIdentifier" : "c:objc(cs)SNClassifySoundRequest"
  },
  "title" : "SNClassifySoundRequest"
}
-->

# SNClassifySoundRequest

A request that classifies sound using a Core ML model.

```
class SNClassifySoundRequest
```

## Overview

An `SNClassifySoundRequest` represents a specific sound classification model. Analyze audio data with a sound classification model by:

1. Creating an `SNClassifySoundRequest`, either with the Sound Analysis model, or by providing your custom Core ML model.
2. Adding the sound request to an [`SNAudioFileAnalyzer`](/documentation/SoundAnalysis/SNAudioFileAnalyzer) or [`SNAudioStreamAnalyzer`](/documentation/SoundAnalysis/SNAudioStreamAnalyzer) to process an audio file or stream, respectively.

```swift
func makeRequest(_ customModel: MLModel? = nil) throws -> SNClassifySoundRequest {
    // If applicable, create a request with a custom sound classification model.
    if let model = customModel {
        let customRequest = try SNClassifySoundRequest(mlModel: model)
        return customRequest
    }

    // Create a request with the Sound Analysis model.
    let version1 = SNClassifierIdentifier.version1
    let request = try SNClassifySoundRequest(classifierIdentifier: version1)

    return request
}

let classifySoundRequest = try makeRequest()

// Prints every label in the request's sound classification model.
print(classifySoundRequest.knownClassifications)
```

For more information about creating and using classify sound requests, see:

- [Classifying Sounds in an Audio File](/documentation/SoundAnalysis/classifying-sounds-in-an-audio-file)
- [Classifying Sounds in an Audio Stream](/documentation/SoundAnalysis/classifying-sounds-in-an-audio-stream)

## Topics

### Creating a Request

[`init(mlModel:)`](/documentation/SoundAnalysis/SNClassifySoundRequest/init(mlModel:)-6rmee)

Creates a request that uses a custom sound classification model.

[`init(classifierIdentifier:)`](/documentation/SoundAnalysis/SNClassifySoundRequest/init(classifierIdentifier:))

Creates a request that uses the framework’s built-in sound classification model.

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

An identifier that represents the versions of the framework’s sound classifier.

### Configuring a Request

[`overlapFactor`](/documentation/SoundAnalysis/SNClassifySoundRequest/overlapFactor)

The amount of overlap between successive analysis windows when the model operates on a fixed-size audio block.

[`windowDuration`](/documentation/SoundAnalysis/SNClassifySoundRequest/windowDuration)

The duration of the audio buffer the request sends to the underlying sound classifier for each prediction.

### Inspecting a Request

[`knownClassifications`](/documentation/SoundAnalysis/SNClassifySoundRequest/knownClassifications)

A string array that contains every prediction label in the request’s underlying sound classifier model.

[`SNTimeDurationConstraint`](/documentation/SoundAnalysis/SNTimeDurationConstraint-swift.enum)

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

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

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

### Instance Properties

[`windowDurationConstraint`](/documentation/SoundAnalysis/SNClassifySoundRequest/windowDurationConstraint-5no60)

A range or list of sound duration times the request’s underlying sound classifier supports.

[`windowDurationConstraint`](/documentation/SoundAnalysis/SNClassifySoundRequest/windowDurationConstraint-5aqvx)

A range or list of sound duration times the request’s underlying sound classifier supports.

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

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



---

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)