FSoundSource

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/Audio.h

Include

#include "Audio.h"

Syntax

class FSoundSource

Variables

Name Description

Protected variable

FAudioDevice &#...

 

AudioDevice

Owning audio device.

Protected variable

uint8: 1

 

bInitialized

Whether or not the sound source is initialized.

Protected variable

uint8: 1

 

bIsManuallyPaused

Whether or not we were paused manually.

Protected variable

uint8: 1

 

bIsPausedByGame

Whether we are paused by game state or not.

Protected variable

uint8: 1

 

bIsPreviewSound

Whether or not the sound is a preview sound.

Protected variable

uint32: 1

 

bIsVirtual

True if this isn't a real hardware voice

Protected variable

uint8: 1

 

bReverbApplied

Cached sound mode value used to detect when to switch outputs.

Protected variable

FSoundBuffer &#...

 

Buffer

Cached sound buffer associated with currently bound wave instance.

Protected variable

float

 

HPFFrequency

What frequency to set the HPF filter to. Note this could be caused by HPF distance attenuation.

Protected variable

int32

 

LastHeardUpdate

Last tick when this source was active and had a hearable volume

Protected variable

float

 

LastHPFFrequency

The last HPF frequency set. Used to avoid making API calls when parameter doesn't changing.

Protected variable

float

 

LastLPFFrequency

The last LPF frequency set. Used to avoid making API calls when parameter doesn't changing.

Protected variable

int32

 

LastUpdate

Last tick when this source was active

Protected variable

FVector

 

LeftChannelSourceLocation

The location of the left-channel source for stereo spatialization.

Protected variable

float

 

LFEBleed

The amount of a sound to bleed to the LFE speaker

Protected variable

float

 

LPFFrequency

What frequency to set the LPF filter to.

Protected variable

int32

 

NumFramesPlayed

The number of frames (Samples / NumChannels) played by the sound source.

Protected variable

int32

 

NumTotalFrames

The total number of frames of audio for the sound wave

Protected variable

uint8: 1

 

Paused

Whether or not we are actually paused.

Protected variable

float

 

Pitch

The pitch of the sound source.

Protected variable

float

 

PlaybackTime

The virtual current playback time. Used to trigger notifications when finished.

Protected variable

FThreadSafeBool

 

Playing

Whether we are playing or not.

Protected variable

FVector

 

RightChannelSourceLocation

The location of the right-channel source for stereo spatialization.

Protected variable

int32

 

StartFrame

The frame we started on.

Protected variable

float

 

StereoBleed

The amount of stereo sounds to bleed to the rear speakers

Protected variable

int32

 

TickCount

Update tick count. Used to stop oldest stopping sound source.

Protected variable

uint32

 

VoiceId

Effect ID of this sound source in the audio device sound source array.

Protected variable

FWaveInstance &...

 

WaveInstance

Contained wave instance.

Constructors

Name Description

Public function

FSoundSource

(
    FAudioDevice* InAudioDevice
)

Constructor

Destructors

Name Description

Public function Virtual

~FSoundSource()

Destructor

Functions

Name Description

Public function Virtual

FString

 

Describe

(
    bool bUseLongName
)

Returns a string describing the source (subclass can override, but it should call the base and append).

Public function Virtual Const

const FSound...

 

GetBuffer()

Returns the contained sound buffer object.

Public function Const

void

 

GetChannelLocations

(
    FVector& Left,
    FVector& Right
)

Protected function

float

 

GetDebugVolume

(
    const float InVolume
)

Returns the volume of the sound source after evaluating debug commands

Public function Virtual Const

float

 

GetEnvelopeValue()

Returns the source's envelope at the callback block rate. Only implemented in audio mixer.

Public function Virtual Const

float

 

GetPlaybackPercent()

Returns the source's playback percent.

Public function

FSpatializat...

 

GetSpatializationParams()

Gets parameters necessary for computing 3d spatialization of sources.

Public function Const

const FWaveI...

 

GetWaveInstance()

Returns the wave instance of the sound source.

Public function

bool

 

Init

(
    FWaveInstance* InWaveInstance
)

Initializes the sound source.

Protected function

void

 

InitCommon()

Initializes common data for all sound source types.

Public function Virtual

void

 

InitializeSourceEffects

(
    uint32 InEffectVoiceId
)

Initializes any source effects for this sound source.

Public function Const

bool

 

IsEQFilterApplied()

Returns true if EQ should be applied.

Public function

bool

 

IsFinished()

Returns true if the sound source has finished playing.

Public function Const

bool

 

IsGameOnly()

Returns source is an in-game only. Will pause when in UI.

Public function Virtual Const

bool

 

IsInitialized()

Returns whether or not the sound source has initialized.

Public function Const

bool

 

IsPaused()

Returns true if the sound is paused.

Public function Const

bool

 

IsPausedByGame()

Returns true if the sound is paused.

Public function Const

bool

 

IsPausedManually()

Public function Const

bool

 

IsPlaying()

Returns whether or not the sound source is playing.

Public function Virtual

bool

 

IsPreparedToInit()

Returns if the source voice is prepared to initialize.

Public function Const

bool

 

IsReverbApplied()

Returns true if reverb should be applied.

Public function Virtual

bool

 

IsStopping()

Whether or not the source is stopping. Only implemented in audio mixer.

Public function

void

 

NotifyPlaybackData()

Protected function

void

 

Pause()

Pauses the sound source.

Public function

void

 

Play()

Plays the sound source.

Public function Virtual

bool

 

PrepareForInitialization

(
    FWaveInstance* InWaveInstance
)

Prepares the source voice for initialization.

Public function

void

 

SetFilterFrequency()

Updates the FilterFrequency value.

Public function

float

 

SetLFEBleed()

Updates and sets the LFEBleed variable.

Public function

void

 

SetPauseByGame

(
    bool bInIsPauseByGame
)

Pause the source from game pause

Public function

void

 

SetPauseManually

(
    bool bInIsPauseManually
)

Pause the source manually

Public function

bool

 

SetReverbApplied

(
    bool bHardwareAvailable
)

Set the bReverbApplied variable.

Public function

float

 

SetStereoBleed()

Set the StereoBleed variable.

Public function

void

 

SetVirtual()

Sets if this voice is virtual.

Public function Virtual

void

 

Stop()

Stops the sound source.

Public function Virtual

void

 

StopNow()

Public function

void

 

Update()

Updates the sound source.

Protected function

void

 

UpdateCommon()

Updates common data for all sound source types.

Protected function

void

 

UpdatePause()

Updates this source's pause state

Public function

void

 

UpdateStereoEmitterPositions()

Updates the stereo emitter positions of this voice.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback