Vixen
02b45cc4
csharp
public readonly record struct SpatialResult

What placing a sound in the world worked out to.

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

Remarks

The parts are returned separately rather than pre-multiplied because the audio debug overlay docs/plan/13 asks for shows exactly this: a source that is inaudible is either too far away or pointing the wrong way, and a single combined number cannot say which.

The last three are here for the built-in parameters, which are read from the game thread while the audio thread writes them. That is the same documented race as Voice.Audibility: every term is a float, so the worst case is a curve evaluated against last block's geometry, which at sixty frames a second is exactly as good.

Fields and properties (8)

  • public float Distance

    How far the source is from the listener.

  • public float Attenuation

    The distance gain alone, before the cone and the listener's own gain.

  • public float ConeGain

    The directional gain alone.

  • public float DopplerRatio

    What to multiply the playback rate by. Above one is approaching, below one is receding.

  • public float LowPassHz

    Where distance has put the air-absorption low-pass, in hertz, or 0 for no filtering at all — which is both the default and the common case, and is a bypass rather than a filter set wide open.

  • public float Azimuth

    Which way round the listener the sound is, in degrees: 0 straight ahead, +90 to the right, ±180 behind.

  • public float Elevation

    How far above or below the listener the sound is, in degrees: +90 overhead, −90 underfoot.

  • public float SourceSpeed

    How fast the source is moving, in units a second, regardless of direction.

Methods (1)

  • public SpatialResult(float Distance, float Attenuation, float ConeGain, float DopplerRatio, float LowPassHz = 0, float Azimuth = 0, float Elevation = 0, float SourceSpeed = 0)

    What placing a sound in the world worked out to.

Used by (4)

  • SpatializerVixen.Audio
  • SpatializerTestsVixen.Audio.Tests
  • VoiceVixen.Audio
  • VoiceParametersVixen.Audio