<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/kAudioSessionCategory_PlayAndRecord",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@Ea@kAudioSessionCategory_AmbientSound@kAudioSessionCategory_PlayAndRecord"
  },
  "title" : "kAudioSessionCategory_PlayAndRecord"
}
-->

# kAudioSessionCategory_PlayAndRecord

Allows recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) app.

```
var kAudioSessionCategory_PlayAndRecord: Int { get }
```

## Discussion

Your audio continues with the Silent switch set to silent and with the screen locked. (The switch is called the *Ring/Silent switch* on iPhone.)

This category is appropriate for simultaneous recording and playback, and also for apps that record and play back but not simultaneously. If you want to ensure that sounds such as Messages alerts do not play while your app is recording, use the [`kAudioSessionCategory_RecordAudio`](/documentation/AudioToolbox/kAudioSessionCategory_RecordAudio) category instead.

This category normally prevents audio from other apps from mixing with your app’s audio. To allow mixing when using this category, use the [`kAudioSessionProperty_OverrideCategoryMixWithOthers`](/documentation/AudioToolbox/kAudioSessionProperty_OverrideCategoryMixWithOthers) property.

This category is equivalent to the <doc://com.apple.documentation/documentation/AVFAudio/AVAudioSession/Category-swift.struct/playAndRecord> category provided in the AVFoundation framework.

---

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)