UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SoundWaveLoadingBehavior.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreTypes.h"
6
7#if WITH_EDITOR
9#endif //WITH_EDITOR
10
11#include "SoundWaveLoadingBehavior.generated.h"
12
22UENUM()
24{
25 // If set on a USoundWave, use the setting defined by the USoundClass. If set on the next parent USoundClass, or the default behavior defined via the au.streamcache cvars.
26 Inherited = 0,
27 // the first chunk of audio for this asset will be retained in the audio cache until a given USoundWave is either destroyed or USoundWave::ReleaseCompressedAudioData is called.
28 RetainOnLoad = 1,
29 // the first chunk of audio for this asset will be loaded into the cache from disk when this asset is loaded, but may be evicted to make room for other audio if it isn't played for a while.
30 PrimeOnLoad = 2,
31 // the first chunk of audio for this asset will not be loaded until this asset is played or primed.
32 LoadOnDemand = 3,
33 // Force all audio data for this audio asset to live outside of the cache and use the non-streaming decode pathways. Only usable if set on the USoundWave.
34 ForceInline = 4 UMETA(DisplayName = "Force Inline"),
35 // This value is used to delineate when the value of ESoundWaveLoadingBehavior hasn't been cached on a USoundWave yet.
37};
38
40
41#if WITH_EDITOR
42
43class USoundWave;
44class USoundClass;
45class ITargetPlatform;
46namespace UE::Cook { class FCookEventContext; }
47
49{
50public:
51 virtual ~ISoundWaveLoadingBehaviorUtil() = default;
52
53 struct FClassData
54 {
55 FClassData() = default;
57
58 bool CompareGreater(const FClassData&, const ITargetPlatform*) const;
59
62 };
63
65
66 virtual FClassData FindOwningLoadingBehavior(const USoundWave*, const ITargetPlatform*) const = 0;
67};
68
69namespace UE::SoundWaveLoadingUtil::Private
70{
71 void RecordSoundWaveLoadingBehaviorDependenciesForCook(UE::Cook::FCookEventContext& CookContext, const USoundWave* SoundWave);
72};
73
74#endif //WITH_EDITOR
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UMETA(...)
Definition ObjectMacros.h:747
#define UENUM(...)
Definition ObjectMacros.h:749
ESoundWaveLoadingBehavior
Definition SoundWaveLoadingBehavior.h:24
ENGINE_API const TCHAR * EnumToString(ESoundWaveLoadingBehavior InCurrentState)
Definition SoundWaveLoadingBehavior.cpp:31
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition SoundClass.h:209
Definition SoundWave.h:417
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
Definition CookOnTheFly.h:19
Definition PerPlatformProperties.h:304