RealDocs

UGameplayStatics::PrimeAllSoundsInSoundClass

function Engine Blueprint Since 4.25
#include "Kismet/GameplayStatics.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Iterates all streaming sound waves belonging to the given sound class and caches their first audio chunk to reduce first-play hitches. Use before a level or event where those sounds will be needed.

Caveats & Gotchas

  • This retains chunk handles, incrementing reference counts; pair each call with UnRetainAllSoundsInSoundClass when the sounds are no longer needed to avoid permanently pinning memory.
  • Priming a large sound class (e.g. your entire SFX class) during gameplay can spike async I/O and cause frame hitches; prefer to call this during a loading screen.
  • Only streaming sounds benefit — fully resident sound waves are already in memory and are silently skipped.

Signature

static ENGINE_API void PrimeAllSoundsInSoundClass(class USoundClass* InSoundClass)

Parameters

Name Type Description Default
InSoundClass class USoundClass* The sound class whose streaming sound waves should be pre-cached.

Return Type

void

Example

Pre-cache combat sounds before a battle C++
// Call during loading transition into combat level
UGameplayStatics::PrimeAllSoundsInSoundClass(CombatSoundClass);

Version History

Introduced in: 4.25

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.