<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioSession/Category-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:@T@AVAudioSessionCategory"
  },
  "title" : "AVAudioSession.Category"
}
-->

# AVAudioSession.Category

Audio session category identifiers.

```
struct Category
```

## Discussion

An audio session category defines a set of audio behaviors. Choose a category that most accurately describes the audio behavior you require.

### Supporting AirPlay

The playback-only categories ([`ambient`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/ambient), [`soloAmbient`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/soloAmbient), and [`playback`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/playback)) support both the mirrored and nonmirrored variants of AirPlay.

The audio session category [`playAndRecord`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/playAndRecord) supports only the mirrored variant of AirPlay, while the [`record`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/record) and [`multiRoute`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/multiRoute) categories don’t allow routing to AirPlay.

> Important:
> SharePlay and the Group Activities API only support audio sessions using the ``doc://com.apple.avfaudio/documentation/AVFAudio/AVAudioSession/Category-swift.struct/playback`` category. Attempting to activate a session that uses an unsupported category results in an error.

## Topics

### Creating a Category

[`init(rawValue:)`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/init(rawValue:))

Creates a new instance with the raw value you specify.

### Getting Standard Categories

[`ambient`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/ambient)

The category for an app in which sound playback is nonprimary — that is, your app also works with the sound turned off.

[`multiRoute`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/multiRoute)

The category for routing distinct streams of audio data to different output devices at the same time.

[`playAndRecord`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/playAndRecord)

The category for recording (input) and playback (output) of audio, such as for a Voice over Internet Protocol (VoIP) app.

[`playback`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/playback)

The category for playing recorded music or other sounds that are central to the successful use of your app.

[`record`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/record)

The category for recording audio while also silencing playback audio.

[`soloAmbient`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/soloAmbient)

The default audio session category.

[`audioProcessing`](/documentation/AVFAudio/AVAudioSession/Category-swift.struct/audioProcessing)

The category for using an audio hardware codec or signal processor while not playing or recording audio.



---

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)