RealDocs

UAudioComponent::SetSourceBufferListener

function Engine Since unknown
#include "Components/AudioComponent.h"
Access: public

Description

Attaches a low-level listener that receives this component's raw audio source buffers as they're rendered, for capture or analysis use cases like procedural visualization or recording.

Caveats & Gotchas

  • This is a C++-only, non-UFUNCTION API for advanced audio-engine integration — there's no Blueprint equivalent.
  • The listener runs on the audio render thread, not the game thread, so any ISourceBufferListener implementation must be thread-safe.
  • Setting bShouldZeroBufferAfter true silences the source in the normal mix, which is easy to forget when debugging 'why did my sound go quiet' after wiring up a buffer listener.

Signature

void SetSourceBufferListener(const FSharedISourceBufferListenerPtr& InSourceBufferListener, bool bShouldZeroBufferAfter)

Parameters

Name Type Description Default
InSourceBufferListener const FSharedISourceBufferListenerPtr& Thread-safe shared pointer to an ISourceBufferListener implementation that receives raw source audio buffers as they render.
bShouldZeroBufferAfter bool If true, the buffer is zeroed out after the listener reads it, silencing the source's contribution to the final mix.

Return Type

void

Example

Attach a buffer listener without muting the source C++
FSharedISourceBufferListenerPtr Listener = MakeShared<FMySourceBufferListener, ESPMode::ThreadSafe>();
AudioComponent->SetSourceBufferListener(Listener, /*bShouldZeroBufferAfter=*/false);

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.