UGameplayStatics::SetMaxAudioChannelsScaled
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Dynamically scales the maximum number of concurrent audio voices as a fraction of the engine's configured maximum. Use this to reduce audio overhead on low-end hardware or during CPU-intensive sequences.
Caveats & Gotchas
- • Reducing the scale mid-session will immediately evict the lowest-priority active voices; sounds already playing may be cut off without a fade.
- • The scale persists for the session; it is not reset automatically between levels. Restore to 1.0 explicitly if you raised the limit temporarily.
Signature
static ENGINE_API void SetMaxAudioChannelsScaled(const UObject* WorldContextObject, float MaxChannelCountScale); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to resolve the current world. | — |
| MaxChannelCountScale | float | Fractional scale applied to the project's configured max voice count. 1.0 = full, 0.5 = half. | — |
Return Type
void Example
Halve voice count during a cutscene C++
// During a CPU-heavy cinematic, reduce audio voices to 50% to save resources.
UGameplayStatics::SetMaxAudioChannelsScaled(this, 0.5f);
// ... cinematic ends ...
UGameplayStatics::SetMaxAudioChannelsScaled(this, 1.0f); Tags
Version History
Introduced in: 4.24
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?