UGameplayStatics::CreateSound2D

This function allows users to create Audio Components in advance of playback with settings specifically for non-spatialized, non-distance-attenuated sounds.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h

Include

#include "Kismet/GameplayStatics.h"

Source

/Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp

Syntax

static UAudioComponent * CreateSound2D
(
    const UObject * WorldContextObject,
    USoundBase * Sound,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundConcurrency * ConcurrencySettings,
    bool bPersistAcrossLevelTransition,
    bool bAutoDestroy
)

Remarks

This function allows users to create Audio Components in advance of playback with settings specifically for non-spatialized, non-distance-attenuated sounds. Audio Components created using this function by default will not have Spatialization applied.

Returns

An audio component to manipulate the created sound

Parameters

Parameter

Description

Sound

Sound to create.

VolumeMultiplier

A linear scalar multiplied with the volume, in order to make the sound louder or softer.

PitchMultiplier

A linear scalar multiplied with the pitch.

StartTime

How far into the sound to begin playback at

ConcurrencySettings

Override concurrency settings package to play sound with

PersistAcrossLevelTransition

Whether the sound should continue to play when the map it was played in is unloaded

bAutoDestroy

Whether the returned audio component will be automatically cleaned up when the sound finishes (by completing or stopping), or whether it can be reactivated

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss