<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AudioServicesPlaySystemSound(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@F@AudioServicesPlaySystemSound"
  },
  "title" : "AudioServicesPlaySystemSound(_:)"
}
-->

# AudioServicesPlaySystemSound(_:)

Plays a system sound object.

```
func AudioServicesPlaySystemSound(_ inSystemSoundID: SystemSoundID)
```

## Parameters

`inSystemSoundID`

The system sound to play. Before using this function, call the [`AudioServicesCreateSystemSoundID(_:_:)`](/documentation/AudioToolbox/AudioServicesCreateSystemSoundID(_:_:)) function to obtain a system sound.

## Discussion

This function plays a short sound (30 seconds or less in duration). Because sound might play for several seconds, this function is executed asynchronously. To know when a sound has finished playing, call the [`AudioServicesAddSystemSoundCompletion(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioServicesAddSystemSoundCompletion(_:_:_:_:_:)) function to register a callback function.

On some iOS devices, you can pass the [`kSystemSoundID_Vibrate`](/documentation/AudioToolbox/kSystemSoundID_Vibrate) constant to invoke vibration. On other iOS devices, calling this function with that constant does nothing.

Sound files that you play using this function must be:

- No longer than 30 seconds in duration
- In linear PCM or IMA4 (IMA/ADPCM) format
- Packaged in a `.caf`, `.aif`, or `.wav` file

In addition, when you use the `AudioServicesPlaySystemSound` function:

- Sounds play at the current system audio volume, with no programmatic volume control available
- Sounds play immediately
- Looping and stereo positioning are unavailable
- Simultaneous playback is unavailable: You can play only one sound at a time
- The sound is played locally on the device speakers; it does not use audio routing.

## See Also

[`AudioServicesAddSystemSoundCompletion(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioServicesAddSystemSoundCompletion(_:_:_:_:_:))

Registers a callback function that is invoked when a specified system sound finishes playing.

[`AudioServicesCreateSystemSoundID(_:_:)`](/documentation/AudioToolbox/AudioServicesCreateSystemSoundID(_:_:))

Creates a system sound object.



---

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)