Skip to content

AudioAPI reference

Struct VoiceHandle

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

A sound playing in an AudioEngine: a voice slot and the generation of the sound that took it. Once the sound ends, is stopped or is stolen by the voice limit, the handle is stale and calls with it do nothing. default is None, which Play also returns for a sound the voice policy refused.

C#
public readonly struct VoiceHandle : IEquatable<VoiceHandle>

Implements

IEquatable<VoiceHandle>

Constructors

VoiceHandle(int, uint)

A sound playing in an AudioEngine: a voice slot and the generation of the sound that took it. Once the sound ends, is stopped or is stolen by the voice limit, the handle is stale and calls with it do nothing. default is None, which Play also returns for a sound the voice policy refused.

C#
public VoiceHandle(int Index, uint Generation)

Parameters

Index int

The voice slot.

Generation uint

The generation of the sound in the slot; 0 only for None.

Properties

Generation

The generation of the sound in the slot; 0 only for None.

C#
public uint Generation { get; init; }

Property Value

uint

Index

The voice slot.

C#
public int Index { get; init; }

Property Value

int

IsNone

Whether this is None.

C#
public bool IsNone { get; }

Property Value

bool

None

No sound.

C#
public static VoiceHandle None { get; }

Property Value

VoiceHandle

Methods

Deconstruct(out int, out uint)

C#
public void Deconstruct(out int Index, out uint Generation)

Parameters

Index int

Generation uint

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(VoiceHandle)

C#
public bool Equals(VoiceHandle other)

Parameters

other VoiceHandle

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(VoiceHandle, VoiceHandle)

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

Parameters

left VoiceHandle

right VoiceHandle

Returns

bool

operator !=(VoiceHandle, VoiceHandle)

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

Parameters

left VoiceHandle

right VoiceHandle

Returns

bool