UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AudioVolume.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
8#pragma once
9
10#include "CoreMinimal.h"
11
13#include "ReverbSettings.h"
14#include "UObject/Class.h"
16
18
19#include "AudioVolume.generated.h"
20
21class AAudioVolume;
22struct FBodyInstance;
23class USoundSubmix;
24
25// Enum describing the state of checking audio volume location
26UENUM(BlueprintType)
28{
29 // Used for when the listener is located inside the Audio Volume
31
32 // Used for when the listener is located outside the Audio Volume
34};
35
37USTRUCT(BlueprintType)
39{
41
42 // The state the listener needs to be in, relative to the audio volume, for this submix send list to be used for a given sound
43 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AudioVolumeSubmixSends)
45
46 UPROPERTY()
48
49 // Submix send array for sounds that are in the ListenerLocationState at the same time as the listener
50 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AudioVolumeSubmixSends)
52};
53
54USTRUCT(BlueprintType)
56{
58
59 // The submix to override the effect chain of
60 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AudioVolumeSubmixSends)
62
63 // The submix effect chain to override
64 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = SoundSubmix)
66
67 // The amount of time to crossfade to the override for the submix chain
68 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = SoundSubmix)
69 float CrossfadeTime = 0.0f;
70};
71
72
74USTRUCT(BlueprintType)
76{
78
79 // Whether these interior settings are the default values for the world
80 UPROPERTY()
81 bool bIsWorldSettings;
82
83 // The desired volume of sounds outside the volume when the player is inside the volume
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=InteriorSettings)
85 float ExteriorVolume;
86
87 // The time over which to interpolate from the current volume to the desired volume of sounds outside the volume when the player enters the volume
88 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=InteriorSettings)
89 float ExteriorTime;
90
91 // The desired LPF frequency cutoff in hertz of sounds outside the volume when the player is inside the volume
92 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = InteriorSettings)
93 float ExteriorLPF;
94
95 // The time over which to interpolate from the current LPF to the desired LPF of sounds outside the volume when the player enters the volume
96 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=InteriorSettings)
97 float ExteriorLPFTime;
98
99 // The desired volume of sounds inside the volume when the player is outside the volume
100 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=InteriorSettings)
101 float InteriorVolume;
102
103 // The time over which to interpolate from the current volume to the desired volume of sounds inside the volume when the player exits the volume
104 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=InteriorSettings)
105 float InteriorTime;
106
107 // The desired LPF frequency cutoff in hertz of sounds inside the volume when the player is outside the volume
108 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = InteriorSettings)
109 float InteriorLPF;
110
111 // The time over which to interpolate from the current LPF to the desired LPF of sounds inside the volume when the player exits the volume
112 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=InteriorSettings)
113 float InteriorLPFTime;
114
116
117 ENGINE_API bool operator==(const FInteriorSettings& Other) const;
118 ENGINE_API bool operator!=(const FInteriorSettings& Other) const;
119
120#if WITH_EDITORONLY_DATA
121 ENGINE_API void PostSerialize(const FArchive& Ar);
122#endif
123};
124
125#if WITH_EDITORONLY_DATA
126template<>
127struct TStructOpsTypeTraits<FInteriorSettings> : public TStructOpsTypeTraitsBase2<FInteriorSettings>
128{
129 enum
130 {
131 WithPostSerialize = true,
132 };
133};
134#endif
135
150
151UCLASS(hidecategories=(Advanced, Attachment, Collision, Volume), MinimalAPI)
153{
155
156private:
161 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=AudioVolume, meta=(AllowPrivateAccess="true"))
162 float Priority;
163
165 UPROPERTY(EditAnywhere, BlueprintReadOnly, ReplicatedUsing=OnRep_bEnabled, Category=AudioVolume, meta=(AllowPrivateAccess="true"))
166 uint32 bEnabled:1;
167
169 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Reverb, meta=(AllowPrivateAccess="true"))
170 FReverbSettings Settings;
171
173 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=AmbientZone, meta=(AllowPrivateAccess="true"))
174 FInteriorSettings AmbientZoneSettings;
175
177 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Submixes, meta = (AllowPrivateAccess = "true"))
179
181 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Submixes, meta = (AllowPrivateAccess = "true"))
182 TArray<FAudioVolumeSubmixOverrideSettings> SubmixOverrideSettings;
183
184public:
185
186 float GetPriority() const { return Priority; }
187
188 UFUNCTION(BlueprintCallable, Category=AudioVolume)
189 ENGINE_API void SetPriority(float NewPriority);
190
191 bool GetEnabled() const { return bEnabled; }
192
193 UFUNCTION(BlueprintCallable, Category=AudioVolume)
194 ENGINE_API void SetEnabled(bool bNewEnabled);
195
196 const FReverbSettings& GetReverbSettings() const { return Settings; }
197
198 UFUNCTION(BlueprintCallable, Category=AudioVolume)
199 ENGINE_API void SetReverbSettings(const FReverbSettings& NewReverbSettings);
200
201 const FInteriorSettings& GetInteriorSettings() const { return AmbientZoneSettings; }
202
203 UFUNCTION(BlueprintCallable, Category=AudioVolume)
204 ENGINE_API void SetInteriorSettings(const FInteriorSettings& NewInteriorSettings);
205
206 const TArray<FAudioVolumeSubmixSendSettings>& GetSubmixSendSettings() const { return SubmixSendSettings; }
207
208 UFUNCTION(BlueprintCallable, Category = AudioVolume)
210
211 const TArray<FAudioVolumeSubmixOverrideSettings>& GetSubmixOverrideSettings() const { return SubmixOverrideSettings; }
212
213 UFUNCTION(BlueprintCallable, Category = AudioVolume)
215
216private:
217
218 UFUNCTION()
219 ENGINE_API virtual void OnRep_bEnabled();
220
221 ENGINE_API void TransformUpdated(USceneComponent* RootComponent, EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport);
222
223 ENGINE_API void AddProxy() const;
224 ENGINE_API void RemoveProxy() const;
225 ENGINE_API void UpdateProxy() const;
226
227public:
228
229 //~ Begin UObject Interface
230#if WITH_EDITOR
231 ENGINE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
232#endif // WITH_EDITOR
233 ENGINE_API virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
234 //~ End UObject Interface
235
236 //~ Begin AActor Interface
237 ENGINE_API virtual void PostUnregisterAllComponents() override;
238 ENGINE_API virtual void PostRegisterAllComponents() override;
239 //~ End AActor Interface
240};
EUpdateTransformFlags
Definition ActorComponent.h:95
int Volume
Definition AndroidPlatformMisc.cpp:380
EAudioVolumeLocationState
Definition AudioVolume.h:28
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ETeleportType
Definition EngineTypes.h:2401
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AudioVolume.h:153
const FReverbSettings & GetReverbSettings() const
Definition AudioVolume.h:196
const TArray< FAudioVolumeSubmixSendSettings > & GetSubmixSendSettings() const
Definition AudioVolume.h:206
float GetPriority() const
Definition AudioVolume.h:186
bool GetEnabled() const
Definition AudioVolume.h:191
const FInteriorSettings & GetInteriorSettings() const
Definition AudioVolume.h:201
const TArray< FAudioVolumeSubmixOverrideSettings > & GetSubmixOverrideSettings() const
Definition AudioVolume.h:211
Definition Volume.h:18
Definition Archive.h:1208
Definition Array.h:670
Definition SoundEffectSubmix.h:26
Definition SoundSubmix.h:334
TArray< TObjectPtr< USoundEffectSubmixPreset > > SubmixEffectChain
Definition SoundSubmix.h:344
Definition AudioVolume.h:137
FInteriorSettings InteriorSettings
Definition AudioVolume.h:144
FReverbSettings ReverbSettings
Definition AudioVolume.h:143
bool bChanged
Definition AudioVolume.h:148
TArray< FAudioVolumeSubmixSendSettings > SubmixSendSettings
Definition AudioVolume.h:145
uint32 AudioVolumeID
Definition AudioVolume.h:140
TArray< FAudioVolumeSubmixOverrideSettings > SubmixOverrideSettings
Definition AudioVolume.h:146
FBodyInstance * BodyInstance
Definition AudioVolume.h:147
uint32 WorldID
Definition AudioVolume.h:141
float Priority
Definition AudioVolume.h:142
Definition AudioVolume.h:56
Definition AudioVolume.h:39
Definition BodyInstance.h:320
Definition AudioVolume.h:76
Definition UnrealType.h:6865
Definition ReverbSettings.h:49
Definition SoundSubmixSend.h:146
Definition ObjectPtr.h:488
Definition StructOpsTypeTraits.h:11
@ WithPostSerialize
Definition StructOpsTypeTraits.h:25
Definition StructOpsTypeTraits.h:46