NSSound
A simple interface for loading and playing audio files.
Declaration
class NSSoundOverview
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
canInit(with:)init(contentsOfFile:byReference:)init(contentsOf:byReference:)init(data:)init(pasteboard:)
Configuring Sounds
nameNSSound.NamesetName(_:)volumecurrentTimeloopsplaybackDeviceIdentifierNSSound.PlaybackDeviceIdentifier