Analyze streamed and file-based audio to classify it as a particular type.


Use the SoundAnalysis framework to analyze audio and recognize it as a particular type, such as laughter or applause. The framework performs its analysis using a Core ML model trained by an MLSoundClassifier. Using the framework’s ability to analyze streamed or file-based audio lets you add intelligent audio recognition capabilites to your app.


Audio Analyzers

Analyzing Audio to Classify Sounds

Use the SoundAnalysis framework and Core ML to analyze audio.

class SNAudioFileAnalyzer

An object you create to analyze an audio file and provide the results to your app.

class SNAudioStreamAnalyzer

An object you create to analyze a stream of audio data and provide the results to your app.

Configuration and Classification

class SNClassifySoundRequest

A request to perform sound classification using a Core ML model.

class SNClassificationResult

A result containing the highest-ranking classifications in the specified time range.

protocol SNResultsObserving

The interface through which your app receives the results of an analysis request.

class SNClassification

The model’s classification of the analyzed sound combined with its level of confidence in that classification.

Request Management

protocol SNRequest

A protocol that defines the configuration of sound analysis requests.

protocol SNResult

A protocol that defines the configuration of sound analysis results.


let SNErrorDomain: String

A string that identifies the SoundAnalysis error domain.

struct SNError

An error raised by the SoundAnalysis framework.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software