RealDocs

UGameplayStatics::UnRetainAllSoundsInSoundClass

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

Description

Releases the retained streaming chunk handles for all sound waves in the given sound class, making those chunks eligible for eviction from the audio streaming cache. Call this after sounds are no longer needed.

Caveats & Gotchas

  • Releasing handles does not immediately evict the chunks — it simply removes the pin so the streaming cache can evict them under memory pressure.
  • Calling this without a prior PrimeAllSoundsInSoundClass for the same class is a no-op but not an error.
  • If a sound from the class is currently playing, its chunk will not be evicted even after un-retaining — eviction only affects chunks that are not in active use.

Signature

static ENGINE_API void UnRetainAllSoundsInSoundClass(class USoundClass* InSoundClass)

Parameters

Name Type Description Default
InSoundClass class USoundClass* The sound class whose retained chunk handles should be released.

Return Type

void

Example

Release combat audio cache on level exit C++
void ACombatManager::EndCombat()
{
	UGameplayStatics::UnRetainAllSoundsInSoundClass(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.