Contents

NSSound

A simple interface for loading and playing audio files.

Declaration

class NSSound

Overview

You create a sound object with an audio file or data, which can be in any format that Core Audio supports. Customize the sound by configuring its properties, such as setting its playback volume and looping behavior. Call the sound’s play() method to begin playback. The system executes this call asynchronously so that it doesn’t interrupt the functioning of your app.

If you want to play the system beep sound, use the beep() (Swift) or NSBeep (Objective-C) function.

Topics

Detecting When a Sound Finishes Playing

Creating Sounds

Configuring Sounds

Getting Sound Information

Playing Sounds

Writing Sounds

Constants

Initializers