# AudioEvent

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

```
struct AudioEvent
```

AudioEvent is an audio event asset.

## Bus

```
field Bus aego/audio.Bus
```

Routes voices started by this event to the selected audio bus.

## Cooldown

```
field Cooldown float
```

Sets the minimum interval between accepted triggers of this event in seconds; zero disables the interval limit.

## Loop

```
field Loop bool
```

Repeats each started voice until it is stopped, including any selected clip variant.

## MaxDistance

```
field MaxDistance float
```

Sets the outer attenuation distance in world units. For spatial audio it must exceed MinDistance.

## MaxVoices

```
field MaxVoices int
```

Limits simultaneous voices of this event; zero imposes no event-specific limit. The mixer still has its own voice budget.

## MinDistance

```
field MinDistance float
```

Sets the inner distance in world units before spatial distance attenuation begins.

## PanWidth

```
field PanWidth float
```

Scales spatial stereo panning from 0 (centred) to 1 (full width); it does not change distance attenuation.

## PauseWith

```
field PauseWith aego/audio.PauseWith
```

Chooses Game to pause voices with the game, or Never to keep them playing during game pause.

## Pitch

```
field Pitch float
```

Sets base playback speed and pitch together, from 0.25 to 4; 1 preserves the clip's original speed.

## PitchRand

```
field PitchRand float
```

Sets the random pitch fraction from 0 to 1. Each trigger multiplies Pitch by a random factor between 1−PitchRand and 1+PitchRand.

## Priority

```
field Priority int
```

Sets mixer voice priority from 0 to 255; higher-priority sounds are preferred under voice pressure.

## Spatial

```
field Spatial bool
```

Enables listener-relative distance attenuation and panning instead of nonspatial playback.

## Steal

```
field Steal aego/audio.Steal
```

Chooses whether reaching MaxVoices rejects the new trigger or replaces an existing voice by age or quietness.

## Volume

```
field Volume float
```

Sets base linear gain from 0 to 2 before event randomisation and the clip and bus gains; zero is silent.

## VolumeRand

```
field VolumeRand float
```

Sets the random gain reduction fraction from 0 to 1. Each trigger uses a gain between Volume×(1−VolumeRand) and Volume.
