UGameplayStatics::GetMaxAudioChannelCount
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Returns the effective maximum number of concurrent audio voices after applying any active scale set by SetMaxAudioChannelsScaled.
Caveats & Gotchas
- • Returns 0 on dedicated servers and other contexts where no audio device exists — guard against this if your code path can run outside a game client.
- • The returned count reflects the scaled limit, not the raw project setting; query both if you need the base value.
Signature
static ENGINE_API int32 GetMaxAudioChannelCount(const UObject* WorldContextObject); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to resolve the current world. | — |
Return Type
int32 Example
Log current max voice count C++
int32 MaxChannels = UGameplayStatics::GetMaxAudioChannelCount(this);
UE_LOG(LogAudio, Log, TEXT("Max audio channels: %d"), MaxChannels); Tags
Version History
Introduced in: 4.24
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?