UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SoundSourceBusSend.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Curves/CurveFloat.h"
7#include "SoundSourceBusSend.generated.h"
8
10class UAudioBus;
11
12UENUM(BlueprintType)
14{
15 // A send based on linear interpolation between a distance range and send-level range
16 Linear,
17
18 // A send based on a supplied curve
20
21 // A manual send level (Uses the specified constant send level value. Useful for 2D sounds.)
22 Manual,
23};
24
25USTRUCT(BlueprintType)
27{
29
30 /*
31 Manual: Use Send Level only
32 Linear: Interpolate between Min and Max Send Levels based on listener distance (between Min/Max Send Distance)
33 Custom Curve: Use the float curve to map Send Level to distance (0.0-1.0 on curve maps to Min/Max Send Distance)
34 */
35 UPROPERTY(EditAnywhere, Category = BusSend, meta = (DisplayName = "Send Level Control Method"))
36 ESourceBusSendLevelControlMethod SourceBusSendLevelControlMethod;
37
38 // The Source Bus to send the audio to
39 UPROPERTY(EditAnywhere, Category = BusSend)
40 TObjectPtr<USoundSourceBus> SoundSourceBus;
41
42 // The Audio Bus to send the audio to
43 UPROPERTY(EditAnywhere, Category = BusSend)
45
46 // Manually set the amount of audio to send to the bus
47 UPROPERTY(EditAnywhere, Category = BusSend, meta = (DisplayName = "Manual Send Level", EditCondition = "SourceBusSendLevelControlMethod == ESourceBusSendLevelControlMethod::Manual", EditConditionHides))
48 float SendLevel;
49
50 // The amount to send to the bus when sound is located at a distance less than or equal to value specified in the Min Send Distance
51 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = BusSend, meta = (EditCondition = "SourceBusSendLevelControlMethod == ESourceBusSendLevelControlMethod::Linear", EditConditionHides))
52 float MinSendLevel;
53
54 // The amount to send to the bus when sound is located at a distance greater than or equal to value specified in the Max Send Distance
55 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = BusSend, meta = (EditCondition = "SourceBusSendLevelControlMethod == ESourceBusSendLevelControlMethod::Linear", EditConditionHides))
56 float MaxSendLevel;
57
61 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = BusSend, meta = (EditCondition = "SourceBusSendLevelControlMethod != ESourceBusSendLevelControlMethod::Manual", EditConditionHides))
62 float MinSendDistance;
63
67 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = BusSend, meta = (EditCondition = "SourceBusSendLevelControlMethod != ESourceBusSendLevelControlMethod::Manual", EditConditionHides))
68 float MaxSendDistance;
69
70 // The custom send curve to use for distance-based send level. (0.0-1.0 on the curve's X-axis maps to Min/Max Send Distance)
71 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = BusSend, meta = (EditCondition = "SourceBusSendLevelControlMethod == ESourceBusSendLevelControlMethod::CustomCurve", EditConditionHides))
72 FRuntimeFloatCurve CustomSendLevelCurve;
73
75 : SourceBusSendLevelControlMethod(ESourceBusSendLevelControlMethod::Manual)
76 , SoundSourceBus(nullptr)
77 , AudioBus(nullptr)
78 , SendLevel(1.0f)
79 , MinSendLevel(0.0f)
80 , MaxSendLevel(1.0f)
81 , MinSendDistance(100.0f)
82 , MaxSendDistance(1000.0f)
83 {
84 }
85};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
ESourceBusSendLevelControlMethod
Definition SoundSourceBusSend.h:14
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition AudioBus.h:76
Definition CurveFloat.h:13
Definition SoundSourceBusSend.h:27
Definition ObjectPtr.h:488