# NSSound

Generated at 2026-02-17 21:02:56 +0000

Load, manipulate and play sounds

2002, 2009 Free Software Foundation, Inc.
Software documentation for the NSSound class
AppKit/NSSound.h
NSCoding
NSCopying
Description forthcoming.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
canInitWithPasteboard:
pasteboard
Description forthcoming.
soundNamed:
name
Description forthcoming.
soundUnfilteredFileTypes
Provides an array of file types that NSSound can understand. The returning array may be directly passed to [NSOpenPanel -runModalForTypes:].

Built with libsndfile:

wav, aiff, aifc, aif, au, snd, mat, mat4, mat5, paf, sf, voc, w64, xi, caf, sd2, flac, ogg, oga

Built without libsndfile:

wav, aiff, aifc, aif, au, snd
soundUnfilteredPasteboardTypes
Description forthcoming.
soundUnfilteredTypes
Description forthcoming.
channelMapping
Description forthcoming.
currentTime
Returns the current position of the audio playback.
delegate
Returns the receiver's delegate
duration
Returns the length, in seconds, of the receiver.
initWithContentsOfFile:
path
byReference:
byRef
Initalizes the receiver object with the contents of file located at path. If byRef is set to `YES` only the name of the NSSound is encoded with -encodeWithCoder: ; if set to `NO` the data is encoded.

See Also:

-initWithContentsOfURL:byReference:
-initWithData:
initWithContentsOfURL:
url
byReference:
byRef
Initializes the receiver object with the contents of the data located in url. If byRef is set to `YES` only the name of the NSSound is encoded with -encodeWithCoder: ; if set to `NO` the data is encoded.

See Also:

-initWithContentsOfFile:byReference:
-initWithData:
initWithData:
data
Initializes the receiver object with the contents of data with a valid magic number.

See Also:

-initWithContentsOfFile:byReference:
-initWithContentsOfURL:byReference:
initWithPasteboard:
pasteboard
Description forthcoming.
isPlaying
Description forthcoming.
loops
Returns the current loop property of the receiver. `YES` indicates this NSSound will restart once it reaches the end, otherwise `NO`.
name
Returns the name of the receiver. Use -setName: to set the name.
pause
Pauses audio playback.

Returns `NO` if receiver could not be paused or is already paused, and `YES` if receiver was successfully paused.

play
Start audio playback. Playback is done asynchronously.

Returns `NO` if receiver is already playing or if an error occurred, and `YES` if receiver was started successfully.

playbackDeviceIdentifier
Description forthcoming.
resume
Resume audio playback after a -pause .

Returns `NO` if receiver is already playing or if an error occurred, and `YES` if receiver was successfully restarted/resumed.

setChannelMapping:
channelMapping
Description forthcoming.
setCurrentTime:
currentTime
Sets the current time of the audio playback.
setDelegate:
aDelegate
Sets the receiver's delegate
setLoops:
loops
Sets the loop property of the receiver. `YES` indicates this NSSound will restart once it reaches the end, otherwise `NO`.
setName:
aName
Sets the receiver's name. Method -name will return aName.
setPlaybackDeviceIdentifier:
playbackDeviceIdentifier
Description forthcoming.
setVolume:
volume
Sets the volume of the receiver. Volume must be between 0.0 and 1.0.
stop
Stop audio playback.

Return `YES` if receiver was successfully stopped.

This method will close the playback device.

volume
Returns the volume of the receiver. Volume will be between 0.0 and 1.0.
writeToPasteboard:
pasteboard
Description forthcoming.
Software documentation for the NSBundle(NSSoundAdditions) category
AppKit/NSSound.h
Description forthcoming.
pathForSoundResource:
name
Description forthcoming.
Software documentation for the NSObject(NSSoundDelegate) informal protocol
AppKit/NSSound.h
Description forthcoming.
sound:
sound
didFinishPlaying:
aBool
Method called when sound has finished playing. Currently this method is not called.