Instance Method

path(forSoundResource:)

Returns the location of the specified sound resource file.

Declaration

func path(forSoundResource name: NSSound.Name) -> String?

Parameters

name

The name of the sound resource file, without any pathname information. Including a filename extension is optional

Return Value

The absolute pathname of the resource file or nil if the file was not found.

Discussion

Sound resources are those files in the bundle that are recognized by the NSSound class. The types of sound files can be determined by calling the soundUnfilteredFileTypes method of NSSound.

See Also