UAudioComponent::GetSourceBufferListener
#include "Components/AudioComponent.h"
Access: public
Specifiers: inline
Description
Returns the source buffer listener currently attached via SetSourceBufferListener(), or an empty shared pointer if none is set.
Caveats & Gotchas
- • The returned reference is only valid while the component is alive — don't cache it past the component's lifetime.
- • Always check the returned pointer with IsValid() before use; most components never have a listener attached.
Signature
const FSharedISourceBufferListenerPtr& GetSourceBufferListener() const { return SourceBufferListener; } Return Type
const FSharedISourceBufferListenerPtr& Example
Check for an existing listener C++
if (AudioComponent->GetSourceBufferListener().IsValid())
{
UE_LOG(LogTemp, Log, TEXT("Buffer listener already attached"));
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?