UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SoundSourceBus.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6#include "UObject/Object.h"
9#include "Sound/AudioBus.h"
10#include "SoundSourceBus.generated.h"
11
12class USoundSourceBus;
14class FAudioDevice;
15
16// The number of channels to mix audio into the source bus
17UENUM(BlueprintType)
19{
20 Mono,
21 Stereo,
22};
23
24// A source bus is a type of USoundBase and can be "played" like any sound.
25UCLASS(hidecategories= (Compression, SoundWave, Streaming, Subtitles, Analysis, Format, Loading, Info, ImportSettings), ClassGroup = Sound, meta = (BlueprintSpawnableComponent), MinimalAPI)
26class USoundSourceBus : public USoundWave
27{
29
30public:
31
33 UPROPERTY(EditAnywhere, Category = BusProperties)
35
37 UPROPERTY(EditAnywhere, Category = BusProperties, meta = (UIMin = 0.0, ClampMin = 0.0))
38 float SourceBusDuration;
39
41 UPROPERTY(EditAnywhere, Category = BusProperties)
43
45 UPROPERTY(meta = (DeprecatedProperty))
47
48 //~ Begin UObject Interface.
50#if WITH_EDITOR
51 virtual bool CanVisualizeAsset() const override
52 {
53 return false;
54 }
55
56 ENGINE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
57
58 // Override the SoundWave behavior so that we don't ask DDC for compressed data.
59 virtual void BeginCacheForCookedPlatformData(const ITargetPlatform* TargetPlatform) override {};
60 virtual bool IsCachedCookedPlatformDataLoaded(const ITargetPlatform* TargetPlatform) override { return true; };
61 virtual void ClearCachedCookedPlatformData(const ITargetPlatform* TargetPlatform) override {};
62
63#endif // WITH_EDITOR
64 //~ End UObject Interface.
65
66 //~ Begin USoundWave Interface
67#if WITH_EDITORONLY_DATA
68 virtual void CachePlatformData(bool bAsyncCache = false) override {};
69 virtual void BeginCachePlatformData() override {}
70 virtual void FinishCachePlatformData() override {};
71#endif //WITH_EDITOR_ONLY_DATA
72 virtual void Serialize(FArchive& InArchive) override;
73 virtual void SerializeCookedPlatformData(FArchive& Ar) override {}
74 virtual bool IsSeekable() const override { return false; }
75 //~ End USoundWave Interface
76
77 //~ Begin USoundBase Interface.
78 ENGINE_API virtual bool IsPlayable() const override;
79 ENGINE_API virtual float GetDuration() const override;
80 //~ End USoundBase Interface.
81
82protected:
83 ENGINE_API void Init();
84
85 // SourceBus doesn't represent a wav file, don't do anything when serializing cue points
86 virtual void SerializeCuePoints(FArchive& Ar, const bool bIsLoadingFromCookedArchive) {}
87};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void Init()
Definition LockFreeList.h:4
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
ESourceBusChannels
Definition SoundSourceBus.h:19
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition AudioDevice.h:417
Definition AudioBus.h:76
Definition SoundWaveProcedural.h:28
Definition SoundWave.h:417
virtual ENGINE_API void SerializeCookedPlatformData(class FArchive &Ar)
Definition AudioDerivedData.cpp:2317
virtual ENGINE_API bool IsPlayable() const override
Definition SoundWave.cpp:4097
virtual ENGINE_API void SerializeCuePoints(FArchive &Ar, const bool bIsLoadingFromCookedArchive)
Definition SoundWave.cpp:5118
virtual ENGINE_API float GetDuration() const override
Definition SoundWave.cpp:4102
virtual ENGINE_API bool IsSeekable() const
Definition SoundWave.cpp:4199
Definition UnrealType.h:6865
Definition ObjectPtr.h:488