---
title: "analyze(for:)"
framework: musicunderstanding
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+, watchOS 27.0+]
path: "musicunderstanding/musicunderstandingsession/analyze(for:)"
---

# analyze(for:)

Performs the specified analyses on the session’s audio source.

## Declaration

```swift
@discardableResult func analyze(for analysisTypes: Set<AnalysisType>) async throws -> MusicUnderstandingSession.SessionResult
```

## Parameters

- `analysisTypes`: A Set of AnalysisType values specifying which analyses to perform.

## Return Value

Return Value The aggregated session result containing all requested analyses.

## Discussion

Discussion note: If the analysis types set is empty, or if analysis is already running on this session. note: Call this method only once per session instance. Create a new session to run additional analyses. Example usage: let session = MusicUnderstandingSession(audioProvider: provider) let result = try await session.analyze(for: [.rhythm, .pace, .loudness])

## See Also

### Performing an analysis

- [analyze()](musicunderstanding/musicunderstandingsession/analyze().md)
