Skip to content

AudioAPI reference

Struct PlayParameters

Namespace: MicroEngine.Audio
Assembly: MicroEngine.Audio.dll
Guide: Audio

How a sound plays.

C#
public readonly struct PlayParameters : IEquatable<PlayParameters>

Implements

IEquatable<PlayParameters>

Constructors

PlayParameters()

Creates the defaults: full volume, original pitch, centred, once, priority 0, on the “sfx” bus.

C#
public PlayParameters()

Properties

Bus

The bus the sound plays through (“sfx” by default; the engine also has “music” and “master”).

C#
public string Bus { get; init; }

Property Value

string

Loop

Whether the sound restarts when it reaches its end.

C#
public bool Loop { get; init; }

Property Value

bool

Pan

Stereo position, 0 (left) to 1 (right); 0.5 is centred. Balance panning: the far side is attenuated.

C#
public float Pan { get; init; }

Property Value

float

Pitch

Playback speed factor, 1 for the original pitch (clamped to 0.01..100). Streams play at their own pitch.

C#
public float Pitch { get; init; }

Property Value

float

Priority

The voice policy’s rank: when every voice is busy, a new sound steals the oldest sound of the lowest priority, if that priority is not higher than its own; otherwise the new sound is refused.

C#
public int Priority { get; init; }

Property Value

int

Volume

Volume, 0..1 (clamped).

C#
public float Volume { get; init; }

Property Value

float

Methods

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(PlayParameters)

C#
public bool Equals(PlayParameters other)

Parameters

other PlayParameters

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(PlayParameters, PlayParameters)

C#
public static bool operator ==(PlayParameters left, PlayParameters right)

Parameters

left PlayParameters

right PlayParameters

Returns

bool

operator !=(PlayParameters, PlayParameters)

C#
public static bool operator !=(PlayParameters left, PlayParameters right)

Parameters

left PlayParameters

right PlayParameters

Returns

bool