USoundBase

The base class for a playable sound object

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Sound/SoundBase.h

Include

#include "Sound/SoundBase.h"

Syntax

class USoundBase :
    public UObject,
    public IInterface_AssetUserData

Remarks

The base class for a playable sound object

Variables

Name Description

Public variable

TArray< TObject...

 

AssetUserData

Array of user data stored with the asset

Public variable

TObjectPtr< USo...

 

AttenuationSettings

Attenuation settings package for the sound

Public variable

uint8: 1

 

bBypassVolumeScaleForPriority

Bypass volume weighting priority upon evaluating whether sound should remain active when max channel count is met (See platform Audio Settings).

Public variable

uint8: 1

 

bDebug

When "au.debug.Sounds -debug" has been specified, draw this sound's attenuation shape when the sound is audible.

Public variable

uint8: 1

 

bEnableBaseSubmix

If enabled, sound will route to the Master Submix by default or to the Base Submix if defined.

Public variable

uint8: 1

 

bEnableBusSends

Whether or not to enable sending this audio's output to buses.

Public variable

uint8: 1

 

bEnableSubmixSends

Whether or not to enable Submix Sends other than the Base Submix.

Public variable

uint8: 1

 

bHasConcatenatorNode

Whether or not this sound has a concatenator node.

Public variable

uint8: 1

 

bHasDelayNode

Whether or not this sound has a delay node

Public variable

uint8: 1

 

bOverrideConcurrency

Whether or not to override the sound concurrency object with local concurrency settings.

Public variable

TArray< FSoundS...

 

BusSends

This sound will send its audio output to this list of buses if there are bus instances playing after source effects are processed.

Public variable

FSoundConcurren...

 

ConcurrencyOverrides

If Override Concurrency is true, concurrency settings to use.

Public variable

TSet< TObjectPt...

 

ConcurrencySet

Set of concurrency settings to observe (if override is set to false).

Public variable

TMap< Audio::FD...

 

CurrentPlayCount

Map of device handle to number of times this sound is currently being played using that device(counted if sound is virtualized).

Public variable

float

 

Duration

Duration of sound in seconds.

Public variable

float

 

MaxDistance

The max distance of the asset, as determined by attenuation settings.

Public variable

TArray< FSoundS...

 

PreEffectBusSends

This sound will send its audio output to this list of buses if there are bus instances playing before source effects are processed.

Public variable

float

 

Priority

Used to determine whether sound can play or remain active if channel limit is met, where higher value is higher priority (see platform's Audio Settings 'Max Channels' property).

Public variable

TObjectPtr< USo...

 

SoundClassObject

Sound class this sound belongs to

Public variable

TObjectPtr< USo...

 

SoundSubmixObject

Submix to route sound output to.

Public variable

TArray< FSoundS...

 

SoundSubmixSends

Array of submix sends to which a prescribed amount (see 'Send Level') of this sound is sent.

Public variable

TObjectPtr< USo...

 

SourceEffectChain

The source effect chain to use for this sound.

Public variable

float

 

TotalSamples

Total number of samples (in the thousands).

Public variable

EVirtualization...

 

VirtualizationMode

Virtualization behavior, determining if a sound may revive and how it continues playing when culled or evicted (limited to looping sounds).

Constructors

Name Description

Public function

USoundBase

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual Const

TUniquePtr< ...

 

CreateParameterTransmitter

Creates a parameter transmitter for communicating with active sound instances.

Public function Virtual

ISoundGenera...

 

CreateSoundGenerator

(
    const FSoundGeneratorInitParams& I...
)

Creates a sound generator instance from this sound base.

Public function Virtual Const

bool

 

GetAllDefaultParameters

(
    TArray< FAudioParameter >& OutPara...
)

Gets all the default parameters for this Asset.

Public function Virtual Const

const FSound...

 

GetAttenuationSettingsToApply()

Returns a pointer to the attenuation settings that are to be applied for this node

Public function Const

void

 

GetConcurrencyHandles

(
    TArray< FConcurrencyHandle >& OutC...
)

Returns an array of FSoundConcurrencySettings handles.

Public function Virtual Const

UCurveTable ...

 

GetCurveData()

Returns curves associated with this sound if it has any.

Public function Virtual

float

 

GetDuration()

Returns the length of the sound

Public function Virtual Const

float

 

GetMaxDistance()

Returns the farthest distance at which the sound could be heard

Public function Virtual

float

 

GetPitchMultiplier()

Public function Const

float

 

GetPriority()

Returns the priority to use when evaluating concurrency.

Public function Virtual Const

USoundClass ...

 

GetSoundClass()

Returns the SoundClass used for this sound.

Public function Const

void

 

GetSoundSourceBusSends

(
    EBusSendType BusSendType,
    TArray< FSoundSourceBusSendInfo >&...
)

Returns the sound source sends for this sound.

Public function Virtual Const

USoundSubmix...

 

GetSoundSubmix()

Returns the SoundSubmix used for this sound.

Public function Const

void

 

GetSoundSubmixSends

(
    TArray< FSoundSubmixSendInfo >& Ou...
)

Returns the sound submix sends for this sound.

Public function Virtual

bool

 

GetSoundWavesWithCookedAnalysisData

(
    TArray< USoundWave* >& OutSou...
)

Returns whether the sound has cooked analysis data (e.g. FFT or envelope following data) and returns sound waves which have cooked data.

Public function Virtual Const

float

 

GetSubtitlePriority()

Returns the subtitle priority

Public function Virtual

float

 

GetVolumeMultiplier()

Public function Virtual Const

bool

 

HasAttenuationNode()

Returns whether or not this sound base has an attenuation node.

Public function Const

bool

 

HasConcatenatorNode()

Returns whether or not this sound has a sequencer node, which means it's possible for the owning active sound to persist even though it's not generating audio.

Public function Virtual Const

bool

 

HasCookedAmplitudeEnvelopeData()

Public function Virtual Const

bool

 

HasCookedFFTData()

Queries if the sound has cooked FFT or envelope data.

Public function Const

bool

 

HasDelayNode()

Returns whether or not this sound has a delay node, which means it's possible for the sound to not generate audio for a while.

Public function Virtual Const

bool

 

ImplementsParameterInterface

(
    Audio::FParameterInterfacePtr InPar...
)

Whether or not the given sound is a generator and implements an interface with the given name.

Public function Virtual

void

 

InitParameters

(
    TArray< FAudioParameter >& InParam...,
    FName InFeatureName
)

Called from the Game Thread prior to attempting to pass parameters to the ParameterTransmitter.

Public function Virtual

void

 

InitResources()

Called from the Game Thread prior to attempting to initialize a sound instance.

Public function Virtual

bool

 

IsLooping()

Returns whether or not this sound is looping.

Public function Virtual

bool

 

IsOneShot()

Query if it's one shot. One shot is defined as a sound which is intended to have a fixed duration.

Public function Virtual Const

bool

 

IsParameterValid

(
    const FAudioParameter& InParameter
)

Returns whether parameter is valid input for the given sound

Public function Virtual Const

bool

 

IsPlayable()

Returns whether the sound base is set up in a playable manner

Public function Virtual Const

bool

 

IsPlayWhenSilent()

Returns true if any of the sounds in the sound have "play when silent" enabled.

Public function Virtual

void

 

Parse

(
    FAudioDevice* AudioDevice,
    const UPTRINT NodeWaveInstanceHash,
    FActiveSound& ActiveSound,
    const FSoundParseParameters& Parse...,
    TArray< FWaveInstance* >& Wav...
)

Parses the Sound to generate the WaveInstances to play.

Public function Virtual

bool

 

ShouldApplyInteriorVolumes()

Returns whether or not any part of this sound wants interior volumes applied to it

Public function Virtual Const

bool

 

SupportsSubtitles()

Returns whether sound supports subtitles.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from UObjectBaseUtility

Name Description

Public function Virtual Const

bool

 

CanBeClusterRoot()

Called after load to determine if the object can be a cluster root

Public function Virtual Const

bool

 

CanBeInCluster()

Called during cluster construction if the object can be added to a cluster

Overridden from IInterface_AssetUserData

Name Description

Public function Virtual

void

 

AddAssetUserData

(
    UAssetUserData* InUserData
)

Public function Virtual Const

const TArray...

 

GetAssetUserDataArray()

Public function Virtual

UAssetUserDa...

 

GetAssetUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Public function Virtual

void

 

RemoveUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Deprecated Variables

Name Description

Public variable

uint8: 1

 

bHasVirtualizeWhenSilent_DEPRECATED

Public variable

uint8: 1

 

bOutputToBusOnly_DEPRECATED

Whether or not to only send this audio's output to a bus.

Public variable

int32

 

MaxConcurrentPlayCount_DEPRECATED

Maximum number of times this sound can be played concurrently.

Public variable

TEnumAsByte< EM...

 

MaxConcurrentResolutionRule_DEPRECATED

Public variable

TObjectPtr< USo...

 

SoundConcurrencySettings_DEPRECATED

If Override Concurrency is false, the sound concurrency settings to use for this sound.