---
title: SNClassifySoundRequest
framework: soundanalysis
role: symbol
role_heading: Class
path: soundanalysis/snclassifysoundrequest
---

# SNClassifySoundRequest

A request that classifies sound using a Core ML model.

## Declaration

```swift
class SNClassifySoundRequest
```

## Mentioned in

Classifying Sounds in an Audio File Classifying Sounds in an Audio Stream

## Overview

Overview An SNClassifySoundRequest represents a specific sound classification model. Analyze audio data with a sound classification model by: Creating an SNClassifySoundRequest, either with the Sound Analysis model, or by providing your custom Core ML model. Adding the sound request to an SNAudioFileAnalyzer or SNAudioStreamAnalyzer to process an audio file or stream, respectively. 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 Classifying Sounds in an Audio Stream

## Topics

### Creating a Request

- [init(mlModel:)](soundanalysis/snclassifysoundrequest/init(mlmodel:)-6rmee.md)
- [init(classifierIdentifier:)](soundanalysis/snclassifysoundrequest/init(classifieridentifier:).md)
- [SNClassifierIdentifier](soundanalysis/snclassifieridentifier.md)

### Configuring a Request

- [overlapFactor](soundanalysis/snclassifysoundrequest/overlapfactor.md)
- [windowDuration](soundanalysis/snclassifysoundrequest/windowduration.md)

### Inspecting a Request

- [knownClassifications](soundanalysis/snclassifysoundrequest/knownclassifications.md)
- [SNTimeDurationConstraint](soundanalysis/sntimedurationconstraint-swift.enum.md)

### Instance Properties

- [windowDurationConstraint](soundanalysis/snclassifysoundrequest/windowdurationconstraint-5no60.md)

### Initializers

- [init(MLModel:)](soundanalysis/snclassifysoundrequest/init(mlmodel:)-9p7qz.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [SNRequest](soundanalysis/snrequest.md)

## See Also

### Sound classification requests

- [Classifying Live Audio Input with a Built-in Sound Classifier](soundanalysis/classifying-live-audio-input-with-a-built-in-sound-classifier.md)
- [SNClassificationResult](soundanalysis/snclassificationresult.md)
