26 virtual void Initialize(FSubsystemCollectionBase& Collection)
override;
27 virtual void Deinitialize()
override;
30 UFUNCTION(BlueprintCallable, Category =
"Audio|BGM")
31 bool PlayBGM(
UAudioData* SourceAudioData, FGameplayTag BGMTag,
bool bStopOtherBGM =
true);
33 UFUNCTION(BlueprintCallable, Category =
"Audio|BGM")
36 UFUNCTION(BlueprintPure, Category =
"Audio|BGM")
37 bool IsPlayingBGM(FGameplayTag BGMTag)
const;
39 UFUNCTION(BlueprintCallable, Category =
"Audio|Volume")
40 void SetBGMVolume(
float NewVolume);
42 UFUNCTION(BlueprintCallable, Category =
"Audio|Volume")
43 void SetSFXVolume(
float NewVolume);
45 UFUNCTION(BlueprintCallable, Category =
"Audio|Volume")
46 void SetAMBVolume(
float NewVolume);
49 UFUNCTION(BlueprintCallable, Category =
"Audio|Tag")
50 bool PlayAudioTagAtLocation(
UAudioData* SourceAudioData, FGameplayTag AudioTag, FVector Location);
52 UFUNCTION(BlueprintCallable, Category =
"Audio|Tag")
53 UFMODAudioComponent* StartLoopAudioTag(
UAudioData* SourceAudioData, FGameplayTag AudioTag, USceneComponent* AttachToComponent);
55 UFUNCTION(BlueprintCallable, Category =
"Audio|Tag")
56 void StopLoopAudio(UFMODAudioComponent* LoopAudioComponent);
59 UFUNCTION(BlueprintPure, Category =
"Audio|Volume")
60 FORCEINLINE
float GetBGMVolume()
const
65 UFUNCTION(BlueprintPure, Category =
"Audio|Volume")
66 FORCEINLINE
float GetSFXVolume()
const
71 UFUNCTION(BlueprintPure, Category =
"Audio|Volume")
72 FORCEINLINE
float GetAMBVolume()
const
81 FFMODEventInstance Instance {};
82 bool bLevelChangeContinue =
true;
90 return LoadBus(Settings->GetBGMBus(), CachedBGMBus);
102 return LoadBus(Settings->GetSFXBus(), CachedSFXBus);
114 return LoadBus(Settings->GetAMBBus(), CachedAMBBus);
122 FORCEINLINE UFMODBus*
LoadBus(
const TSoftObjectPtr<UFMODBus>& SourceBus, TObjectPtr<UFMODBus>& CachedBus)
129 if (SourceBus.IsNull())
134 CachedBus = SourceBus.LoadSynchronous();
138 bool IsEventInstancePlaying(
const FFMODEventInstance& EventInstance)
const;
139 void StopEventInstance(
const FFMODEventInstance& EventInstance)
const;
140 void OnPostLoadMap(UWorld* LoadedWorld);
142 void StopBGMByTag(FGameplayTag BGMTag);
146 TObjectPtr<UFMODBus> CachedBGMBus;
149 TObjectPtr<UFMODBus> CachedSFXBus;
152 TObjectPtr<UFMODBus> CachedAMBBus;
157 FDelegateHandle PostLoadMapHandle;
159 float BGMVolume = 1.0f;
160 float SFXVolume = 1.0f;
161 float AMBVolume = 1.0f;
Definition GlobalAudioSubsystem.h:80