Class AudioEventDefinition
An audio event a game registers with IAudioService, by its id.
public sealed class AudioEventDefinition
- Inheritance
-
AudioEventDefinition
- Inherited Members
Properties
Asset
Identifier that points to the underlying implementation asset. For the default SDL implementation this is a relative file path. Middleware backends can interpret the value as a sound bank event name or other lookup key.
public required string Asset { get; init; }
Property Value
Category
The kind of audio. Defaults to SoundEffect.
public AudioEventCategory Category { get; init; }
Property Value
DuckMilliseconds
How long the music takes to go down to DuckMusicDecibels, and to come back up once the last ducking event ends. Defaults to 250.
public int DuckMilliseconds { get; init; }
Property Value
DuckMusicDecibels
Not music: how far the music is lowered while this event plays, in decibels, such as -9. 0, the default, leaves the music alone. While several ducking events play, the strongest applies.
public float DuckMusicDecibels { get; init; }
Property Value
EndingAsset
Music only: a file played after Asset, joined to it with no gap, when the music is finished with FinishMusic(int), or, for music that doesn't loop, when the body has played once. Null for none.
public string EndingAsset { get; init; }
Property Value
EventId
The id the event is posted, stopped and unregistered by. Matching ignores case.
public required string EventId { get; init; }
Property Value
FadeInMilliseconds
How long the event takes to fade in when posted; 0 starts it at full volume. For music, the track playing before fades out over the same time, so the two crossfade.
public int FadeInMilliseconds { get; init; }
Property Value
IntroAsset
Music only: a file played once before Asset, joined to it with no gap. Null for none. With an intro or an ending, Asset is the music's body: what loops.
public string IntroAsset { get; init; }
Property Value
Loop
Whether the event repeats until it is stopped. Otherwise it plays once. For music with an intro or an ending, it is the body that repeats.
public bool Loop { get; init; }
Property Value
Metadata
Extra values the game attaches to the event. The SDL service does not read them.
public IDictionary<string, string> Metadata { get; init; }
Property Value
Volume
The volume, from 0 to 1, before the effects or music volume is applied.
public float Volume { get; init; }
Property Value
VolumeCategory
Which volume setting the event follows, named by category: Music follows MusicVolume, the others EffectsVolume. Null, the default, is the event's own Category. A jingle that is part of the score is a sound effect that follows the music volume.
public AudioEventCategory? VolumeCategory { get; init; }