---
title: "registerSoundAsset(data:identifier:format:normalizationMode:)"
framework: phase
role: symbol
role_heading: Instance Method
path: "phase/phaseassetregistry/registersoundasset(data:identifier:format:normalizationmode:)"
---

# registerSoundAsset(data:identifier:format:normalizationMode:)

Loads a sound asset from memory and adds it to the engine’s list of registered assets.

## Declaration

```swift
func registerSoundAsset(data: Data, identifier: String?, format: AVAudioFormat, normalizationMode: PHASENormalizationMode) throws -> PHASESoundAsset
```

## Parameters

- `data`: A buffer containing the audio data to register. Audio data needs to be single-channel interleaved PCM, or per-channel de-interleaved PCM with buffers organized back to back.
- `identifier`: A unique name for the sound asset. If you provide nil, the framework determines and sets value for the asset’s identifier.
- `format`: And object that describes the audio data layout.
- `normalizationMode`: An option to calibrate the sound asset for the user’s output device.

## Return Value

Return Value A sound asset object. If an error occurs, the function returns nil.

## See Also

### Registering Sound Assets

- [registerSoundAsset(url:identifier:assetType:channelLayout:normalizationMode:)](phase/phaseassetregistry/registersoundasset(url:identifier:assettype:channellayout:normalizationmode:).md)
- [unregisterAsset(identifier:completion:)](phase/phaseassetregistry/unregisterasset(identifier:completion:).md)
