Home › Assets › AFA_Sounds
Assets

AFA_Sounds

Sound class hierarchy, attenuation presets and helper libraries. Sets the project's default sound classes and mix.

What it gives you

  • A sound class hierarchy wired to the settings volumes
  • Attenuation presets from UI to ambient
  • Helper macros for playing sound on actors and components

Requires

None

Required by

AFM_MeshCopy AFM_Settings AFM_Spawner AFM_State AFM_WidgetInteraction AFS_Core_Highlight AFS_Core_Snapping AFS_UI AFS_UX_Gaze AFS_UX_Grip AFS_UX_Laser AFS_UX_Overlap AFS_UX_Select AFS_UX_Teleporter AF_Examples

4 assets2 API members

Description

This module defines how audio is organised. The sound class hierarchy — master, music, SFX, UI, voice — is what the volume settings in AFM_Settings control, and its Engine.ini sets these as the project's defaults along with the default sound mix.

Attenuation presets cover the common distances: UI, near, medium, far and ambient. Using them keeps spatial audio consistent between systems.

Setup

  1. Confirm the project's default sound classes point at SC_Master and the default mix at SMix_Default.
Warning

If your project overrides the default sound class, the framework's volume settings will not apply.

Usage

Playing a sound on an actor

Use ML_Actor_Sound or ML_Comp_Sound so attenuation and sound class are applied consistently.

Choosing attenuation

SA_UI for interface sounds, SA_Near for hand-scale interactions, SA_Medium for object interactions, SA_Far and SA_Ambient for environment.

Key properties

PropertyWhen to change
Sound class assignmentOn your own cues, to route them through the right volume setting
Attenuation presetMatch the interaction's physical scale

Extending

Add your own sound classes as children of SC_Master so they inherit the master volume setting.

Example map

Every interaction sound in the example maps routes through this hierarchy.

Troubleshooting

Volume settings have no effect on my sounds. The cue is not assigned to a sound class under SC_Master.

API reference

Every blueprint asset in this module. Expand an asset to see its members.

Libraries

BFL_Sound2 members
extends BlueprintFunctionLibrary

Function library choosing a sound attenuation from how large a thing is: over two metres takes the far setting, over thirty centimetres the medium one, and anything smaller the near one. The sound macro libraries call it, which is how a sound played at an actor's centre carries as far as the actor is big. Call it directly when playing a sound of your own.

KindNameSignatureDescription
fnGetSoundAttenuationFromBoundsSound(Actor: Actor, __WorldContext: Object, out Attenuation: SoundAttenuation)Returns an attenuation preset chosen from the size of the actor's bounding box, so a large object carries further than a small one. Convenient when spawning a sound on an actor whose scale is not known in advance.
fnDetermineSoundAttenuationFromRadiusSound(Radius: float, __WorldContext: Object) → SoundAttenuationPicks one of the three shipped attenuation presets from a radius in centimetres: near below 30, medium up to 200, far above that. Use it so sounds on objects of very different sizes stay audible over a sensible distance without hand-tuning each one.
ML_Actor_Sound0 members
extends Actor

Macro library for actor graphs. Play Sound At Center plays a sound at the middle of the actor's bounds and picks the attenuation from how large the actor is, so there is no setting to choose by hand. Available in any Actor blueprint; the component and scene component sound libraries do the same job elsewhere.

No editor-visible members; this asset configures defaults only.

ML_Comp_Sound0 members
extends ActorComponent

Macro library for actor component graphs. Play Sound At Center Of Owning Actor plays a sound at the middle of the owner's bounds, with the attenuation taken from the owner's size. The highlight, the grip interaction and the overlap interaction all play their sounds through it.

No editor-visible members; this asset configures defaults only.

ML_SceneComponent_Sound0 members
extends SceneComponent

Macro library for scene component graphs. Play Sound At Component plays a sound at the component's own world location rather than at the actor's centre, with the attenuation taken from the owner's size. Reach for it where the component's position is what the player should hear, as the connector and the teleport ability do.

No editor-visible members; this asset configures defaults only.