Vixen
02b45cc4
csharp
public struct AudioListenerSet

Everywhere the game is listening from at once.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

One set of speakers, several pairs of ears. Split-screen is the case: four players at four places in the world, and one stereo output that has to represent all of them. There is no correct answer to that — the room only has two speakers — so what matters is picking a wrong answer that nobody notices.

Four, because the fifth player does not exist. Local multiplayer stops at four on every console that supports it, and a fixed cap is what lets the whole set live in a struct and go through the same sequence lock a single listener did — no allocation, no list, and one copy per block rather than one per voice.

A set with one listener in it behaves exactly as the single listener did, and that is the path almost every game takes.

Fields and properties (3)

  • public const int MaxListeners

    How many pairs of ears there can be.

  • public int Count

    How many there are.

  • public static AudioListenerSet Default

    The default listener, alone.

Methods (5)

  • public static AudioListenerSet Single(in AudioListener listener)

    A set with one listener in it, at full weight.

  • public bool TryAdd(in AudioListener listener, float weight = 1)

    Adds a listener.

  • public void Clear()

    Empties it.

  • public readonly AudioListener Get(int index)

    One of the listeners.

  • public readonly float WeightOf(int index)

    How much of the mix one listener gets.

Used by (10)

  • AudioEngineVixen.Audio
  • AudioMixerVixen.Audio
  • AudioOcclusionVixen.Audio
  • AudioSystemVixen.Audio
  • ListenerBufferVixen.Audio
  • MultipleListenerTestsVixen.Audio.Tests
  • OcclusionTestsVixen.Audio.Tests
  • SpatializerVixen.Audio
  • VoiceVixen.Audio
  • WeightBufferVixen.Audio