---
title: AVMusicUserEvent
framework: avfaudio
role: symbol
role_heading: Class
path: avfaudio/avmusicuserevent
---

# AVMusicUserEvent

An object that represents a custom user message.

## Declaration

```swift
class AVMusicUserEvent
```

## Overview

Overview When playback of an AVMusicTrack reaches this event, the system calls the track’s callback. You can’t modify the size and contents of an AVMusicUserEvent once you create it.

## Topics

### Creating a User Event

- [init(data:)](avfaudio/avmusicuserevent/init(data:).md)

### Inspecting a User Event

- [sizeInBytes](avfaudio/avmusicuserevent/sizeinbytes.md)

## Relationships

### Inherits From

- [AVMusicEvent](avfaudio/avmusicevent.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Handling Music Events

- [AVMusicEvent](avfaudio/avmusicevent.md)
- [AVParameterEvent](avfaudio/avparameterevent.md)
- [AVAUPresetEvent](avfaudio/avaupresetevent.md)
- [AVExtendedTempoEvent](avfaudio/avextendedtempoevent.md)
- [AVExtendedNoteOnEvent](avfaudio/avextendednoteonevent.md)
