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

# kAudioSessionCategory_AmbientSound

For an app in which sound playback is nonprimary—that is, your app can be used successfully with the sound turned off.

```
var kAudioSessionCategory_AmbientSound: Int { get }
```

## Discussion

This category is appropriate for “play along” style apps, such as a virtual piano that a user plays over iPod audio. When you use this category, audio from other apps mixes with your audio. Your audio is silenced by screen locking and by the Silent switch (called the *Ring/Silent switch* on iPhone).

This category is equivalent to the <doc://com.apple.documentation/documentation/AVFAudio/AVAudioSession/Category-swift.struct/ambient> 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)