<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSound/init(pasteboard:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSound(im)initWithPasteboard:"
  },
  "title" : "init(pasteboard:)"
}
-->

# init(pasteboard:)

Initializes the receiver with data from a pasteboard. The pasteboard should contain a type returned by [`NSSound`](/documentation/AppKit/NSSound). `NSSound` expects the data to have a proper magic number, sound header, and data for the formats it supports.

```
init?(pasteboard: NSPasteboard)
```

## Parameters

`pasteboard`

The pasteboard containing the audio data with which the receiver is to be initialized. The pasteboard must contain a type returned by [`NSSound`](/documentation/AppKit/NSSound). The contained data must have a proper magic number, sound header, and data for the formats the `NSSound` class supports.

## Return Value

Initialized `NSSound` instance.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)