๐ข Runtime Audio Library
Short Description
Small runtime audio helpers exposed to Blueprints and C++. Includes conveniences for playing voice lines with async loading and spawn-time callbacks.
Long Description
UGorgeousAudioBlueprintFunctionLibrary wraps common audio playback flows so gameplay code and tools can play voice lines and handle lifecycle events without boilerplate. The library accepts TSoftObjectPtr references and uses asynchronous loading paths where supported to avoid hitching.
๐ Features
- Play voice lines at an actor location with async load support.
- Callbacks for when the audio component is created and when playback finishes.
- Blueprint-callable API and C++ friendly helpers.
PlayVoiceLineAtActorLocation
Plays a voice line at the specified actor's location. Supports both USoundBase and UDialogueWave types and provides two delegates: one for when the audio component is ready, and one for when the line finishes.
| Parameter Name | Type | Description |
|---|---|---|
Sound |
TSoftObjectPtr<USoundBase> |
Soft reference to the sound or dialogue wave asset. |
Actor |
AActor* |
Actor whose location will be used as the origin. |
OnVoiceLineFinished |
FOnVoiceLineFinishedNative |
Delegate executed when playback has finished. |
OnVoiceLineAudioReady |
FOnVoiceLineAudioReadyNative |
Delegate executed with the spawned UAudioComponent* when audio is ready. |
WorldContextObject |
UObject* |
Optional world context. |
TSoftObjectPtr<USoundBase> MyVoiceLine = TSoftObjectPtr<USoundBase>(FSoftObjectPath("/Game/Audio/VoiceLines/MyLine.MyLine"));
UGorgeousAudioBlueprintFunctionLibrary::PlayVoiceLineAtActorLocation(
MyVoiceLine,
PlayerCharacter,
FOnVoiceLineFinishedNative::CreateLambda([](){ /* finished */ }),
FOnVoiceLineAudioReadyNative::CreateLambda([](UAudioComponent* Audio){ /* ready */ }),
GetWorld()
);
- Pass a soft reference to a sound asset and the target actor. Bind the two delegate outputs to react to audio readiness and completion.
Notes & implementation details
- The implementation detects
UDialogueWavevsUSoundBaseand dispatches toSpawnDialogueAtLocationorSpawnSoundAtLocationrespectively. - Async asset loading paths use engine-version guards (
GORGEOUS_55_HIGHERvsGORGEOUS_54_LOWER) to pick eitherLoadAsyncorFStreamableManagerfallback. - There are
TODOcomments in the source indicating this helper can be extended to use a runtime audio configuration provider (attenuation, volume, context listeners).