Class PlayoutReference
- Namespace
- LiveKit
Taps the final mix Unity sends to the audio output device and feeds it to the echo canceller as the far-end reference.
Attaches itself to the GameObject of the active AudioListener, the virtual microphone in the scene, usually on the camera, which hears the scene and sends the result to the audio output hardware.
public sealed class PlayoutReference : MonoBehaviour
- Inheritance
-
PlayoutReference
- Extension Methods
Remarks
An RtcAudioSource created with EchoCancellation attaches this component to the active listener when it starts and re-attaches it after scene loads and audio device changes. Adding it to the listener yourself is supported and does the same thing.
Because the tap sits after every AudioSource, mixer group and spatializer, the reference is exactly what the loudspeaker plays: every remote participant plus the game's own audio. The MicrophoneSource capture probe clears its buffer after reading, so the local microphone never appears in the mix.
OnAudioFilterRead runs on the Unity audio thread and must not touch Unity APIs, so
the sample rate, listener state and consumer count are cached on the main thread.