---
title: "path(forSoundResource:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/bundle/path(forsoundresource:)"
---

# path(forSoundResource:)

Returns the location of the specified sound resource file.

## Declaration

```swift
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

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

## Discussion

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

### Related Documentation

- [path(forResource:ofType:)](foundation/bundle/path(forresource:oftype:).md)
