UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSoundSource Class Referenceabstract

#include <Audio.h>

+ Inheritance diagram for FSoundSource:

Public Member Functions

 FSoundSource (FAudioDevice *InAudioDevice)
 
virtual ENGINE_API ~FSoundSource ()
 
virtual bool PrepareForInitialization (FWaveInstance *InWaveInstance)
 
virtual bool IsPreparedToInit ()
 
virtual bool Init (FWaveInstance *InWaveInstance)=0
 
virtual bool IsInitialized () const
 
virtual void Update ()=0
 
virtual void Play ()=0
 
virtual ENGINE_API void Stop ()
 
virtual void StopNow ()
 
virtual bool IsStopping ()
 
virtual bool IsFinished ()=0
 
void SetPauseByGame (bool bInIsPauseByGame)
 
void SetPauseManually (bool bInIsPauseManually)
 
virtual ENGINE_API FString Describe (bool bUseLongName)
 
bool IsGameOnly () const
 
const FWaveInstanceGetWaveInstance () const
 
bool IsPlaying () const
 
bool IsPaused () const
 
bool IsPausedByGame () const
 
bool IsPausedManually () const
 
bool IsReverbApplied () const
 
ENGINE_API bool SetReverbApplied (bool bHardwareAvailable)
 
ENGINE_API float SetLFEBleed ()
 
ENGINE_API void SetFilterFrequency ()
 
ENGINE_API void UpdateStereoEmitterPositions ()
 
ENGINE_API FSpatializationParams GetSpatializationParams ()
 
virtual const FSoundBufferGetBuffer () const
 
int32 GetNumChannels () const
 
virtual void InitializeSourceEffects (uint32 InEffectVoiceId)
 
void SetVirtual ()
 
virtual ENGINE_API float GetPlaybackPercent () const
 
virtual ENGINE_API float GetSourceSampleRate () const
 
virtual ENGINE_API int64 GetNumFramesPlayed () const
 
virtual ENGINE_API int32 GetNumTotalFrames () const
 
virtual ENGINE_API int32 GetStartFrame () const
 
virtual float GetEnvelopeValue () const
 
virtual float GetRelativeRenderCost () const
 
ENGINE_API void GetChannelLocations (FVector &Left, FVector &Right) const
 
void NotifyPlaybackData ()
 

Protected Member Functions

ENGINE_API void InitCommon ()
 
ENGINE_API void UpdateCommon ()
 
virtual void Pause ()=0
 
void UpdatePause ()
 
ENGINE_API float GetDebugVolume (const float InVolume)
 

Protected Attributes

FAudioDeviceAudioDevice
 
FWaveInstanceWaveInstance
 
FSoundBufferBuffer
 
float LFEBleed
 
float LPFFrequency
 
float HPFFrequency
 
float LastLPFFrequency =MAX_FILTER_FREQUENCY
 
float LastHPFFrequency =MIN_FILTER_FREQUENCY
 
float PlaybackTime
 
float Pitch
 
int32 LastUpdate
 
int32 LastHeardUpdate
 
int32 TickCount
 
FVector LeftChannelSourceLocation
 
FVector RightChannelSourceLocation
 
int32 NumFramesPlayed
 
int32 NumTotalFrames
 
int32 StartFrame
 
int32 NumChannels = 0
 
uint32 VoiceId
 
FThreadSafeBool Playing
 
uint8 bReverbApplied: 1
 
uint8 bIsPausedByGame: 1
 
uint8 bIsManuallyPaused: 1
 
uint8 Paused: 1
 
uint8 bInitialized: 1
 
uint8 bIsPreviewSound: 1
 
uint32 bIsVirtual: 1
 

Friends

class FAudioDevice
 
struct FActiveSound
 

Constructor & Destructor Documentation

◆ FSoundSource()

FSoundSource::FSoundSource ( FAudioDevice InAudioDevice)
inline

Constructor

◆ ~FSoundSource()

FSoundSource::~FSoundSource ( )
virtualdefault

Destructor

Member Function Documentation

◆ Describe()

FString FSoundSource::Describe ( bool  bUseLongName)
virtual

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

◆ GetBuffer()

virtual const FSoundBuffer * FSoundSource::GetBuffer ( ) const
inlinevirtual

Returns the contained sound buffer object.

◆ GetChannelLocations()

void FSoundSource::GetChannelLocations ( FVector Left,
FVector Right 
) const

◆ GetDebugVolume()

float FSoundSource::GetDebugVolume ( const float  InVolume)
protected

Returns the volume of the sound source after evaluating debug commands

◆ GetEnvelopeValue()

virtual float FSoundSource::GetEnvelopeValue ( ) const
inlinevirtual

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

Reimplemented in Audio::FMixerSource.

◆ GetNumChannels()

int32 FSoundSource::GetNumChannels ( ) const
inline

◆ GetNumFramesPlayed()

int64 FSoundSource::GetNumFramesPlayed ( ) const
virtual

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

Reimplemented in Audio::FMixerSource.

◆ GetNumTotalFrames()

int32 FSoundSource::GetNumTotalFrames ( ) const
virtual

Returns the total number of frames of audio for the sound wave.

◆ GetPlaybackPercent()

float FSoundSource::GetPlaybackPercent ( ) const
virtual

Returns the source's playback percent.

Reimplemented in Audio::FMixerSource.

◆ GetRelativeRenderCost()

virtual float FSoundSource::GetRelativeRenderCost ( ) const
inlinevirtual

Returns the source's estimated relative render cost (relative to a single decoded sound). Used for debug information and to constrain overall CPU usage.

Reimplemented in Audio::FMixerSource.

◆ GetSourceSampleRate()

float FSoundSource::GetSourceSampleRate ( ) const
virtual

Returns the sample (frame) rate of the audio played by the sound source.

◆ GetSpatializationParams()

FSpatializationParams FSoundSource::GetSpatializationParams ( )

Gets parameters necessary for computing 3d spatialization of sources.

◆ GetStartFrame()

int32 FSoundSource::GetStartFrame ( ) const
virtual

Returns the frame index on which the sound source began playback.

◆ GetWaveInstance()

const FWaveInstance * FSoundSource::GetWaveInstance ( ) const
inline

Returns the wave instance of the sound source.

◆ Init()

virtual bool FSoundSource::Init ( FWaveInstance InWaveInstance)
pure virtual

Initializes the sound source.

Implemented in Audio::FMixerSource, and FIOSAudioSoundSource.

◆ InitCommon()

void FSoundSource::InitCommon ( )
protected

Initializes common data for all sound source types.

◆ InitializeSourceEffects()

virtual void FSoundSource::InitializeSourceEffects ( uint32  InEffectVoiceId)
inlinevirtual

Initializes any source effects for this sound source.

◆ IsFinished()

virtual bool FSoundSource::IsFinished ( )
pure virtual

Returns true if the sound source has finished playing.

Implemented in Audio::FMixerSource, and FIOSAudioSoundSource.

◆ IsGameOnly()

bool FSoundSource::IsGameOnly ( ) const

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

◆ IsInitialized()

virtual bool FSoundSource::IsInitialized ( ) const
inlinevirtual

Returns whether or not the sound source has initialized.

Reimplemented in Audio::FMixerSource.

◆ IsPaused()

bool FSoundSource::IsPaused ( ) const
inline

Returns true if the sound is paused.

◆ IsPausedByGame()

bool FSoundSource::IsPausedByGame ( ) const
inline

Returns true if the sound is paused.

◆ IsPausedManually()

bool FSoundSource::IsPausedManually ( ) const
inline

◆ IsPlaying()

bool FSoundSource::IsPlaying ( ) const
inline

Returns whether or not the sound source is playing.

◆ IsPreparedToInit()

virtual bool FSoundSource::IsPreparedToInit ( )
inlinevirtual

Returns if the source voice is prepared to initialize.

Reimplemented in Audio::FMixerSource.

◆ IsReverbApplied()

bool FSoundSource::IsReverbApplied ( ) const
inline

Returns true if reverb should be applied.

◆ IsStopping()

virtual bool FSoundSource::IsStopping ( )
inlinevirtual

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

Reimplemented in Audio::FMixerSource.

◆ NotifyPlaybackData()

void FSoundSource::NotifyPlaybackData ( )

◆ Pause()

virtual void FSoundSource::Pause ( )
protectedpure virtual

Pauses the sound source.

Implemented in Audio::FMixerSource, and FIOSAudioSoundSource.

◆ Play()

virtual void FSoundSource::Play ( )
pure virtual

Plays the sound source.

Implemented in Audio::FMixerSource, and FIOSAudioSoundSource.

◆ PrepareForInitialization()

virtual bool FSoundSource::PrepareForInitialization ( FWaveInstance InWaveInstance)
inlinevirtual

Reimplemented in Audio::FMixerSource.

◆ SetFilterFrequency()

void FSoundSource::SetFilterFrequency ( )

Updates the FilterFrequency value.

◆ SetLFEBleed()

float FSoundSource::SetLFEBleed ( )

Updates and sets the LFEBleed variable.

◆ SetPauseByGame()

void FSoundSource::SetPauseByGame ( bool  bInIsPauseByGame)

Pause the source from game pause

◆ SetPauseManually()

void FSoundSource::SetPauseManually ( bool  bInIsPauseManually)

Pause the source manually

◆ SetReverbApplied()

bool FSoundSource::SetReverbApplied ( bool  bHardwareAvailable)

Set the bReverbApplied variable.

◆ SetVirtual()

void FSoundSource::SetVirtual ( )
inline

Sets if this voice is virtual.

◆ Stop()

void FSoundSource::Stop ( void  )
virtual

Stops the sound source.

Reimplemented in Audio::FMixerSource, and FIOSAudioSoundSource.

◆ StopNow()

virtual void FSoundSource::StopNow ( )
inlinevirtual

Reimplemented in Audio::FMixerSource.

◆ Update()

virtual void FSoundSource::Update ( )
pure virtual

Updates the sound source.

Implemented in Audio::FMixerSource, and FIOSAudioSoundSource.

◆ UpdateCommon()

void FSoundSource::UpdateCommon ( )
protected

Updates common data for all sound source types.

◆ UpdatePause()

void FSoundSource::UpdatePause ( )
protected

Updates this source's pause state

◆ UpdateStereoEmitterPositions()

void FSoundSource::UpdateStereoEmitterPositions ( )

Updates the stereo emitter positions of this voice.

Friends And Related Symbol Documentation

◆ FActiveSound

◆ FAudioDevice

friend class FAudioDevice
friend

Member Data Documentation

◆ AudioDevice

FAudioDevice* FSoundSource::AudioDevice
protected

Owning audio device.

◆ bInitialized

uint8 FSoundSource::bInitialized
protected

Whether or not the sound source is initialized.

◆ bIsManuallyPaused

uint8 FSoundSource::bIsManuallyPaused
protected

Whether or not we were paused manually.

◆ bIsPausedByGame

uint8 FSoundSource::bIsPausedByGame
protected

Whether we are paused by game state or not.

◆ bIsPreviewSound

uint8 FSoundSource::bIsPreviewSound
protected

Whether or not the sound is a preview sound.

◆ bIsVirtual

uint32 FSoundSource::bIsVirtual
protected

True if this isn't a real hardware voice

◆ bReverbApplied

uint8 FSoundSource::bReverbApplied
protected

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

◆ Buffer

FSoundBuffer* FSoundSource::Buffer
protected

Cached sound buffer associated with currently bound wave instance.

◆ HPFFrequency

float FSoundSource::HPFFrequency
protected

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

◆ LastHeardUpdate

int32 FSoundSource::LastHeardUpdate
protected

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

◆ LastHPFFrequency

float FSoundSource::LastHPFFrequency =MIN_FILTER_FREQUENCY
protected

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

◆ LastLPFFrequency

float FSoundSource::LastLPFFrequency =MAX_FILTER_FREQUENCY
protected

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

◆ LastUpdate

int32 FSoundSource::LastUpdate
protected

Last tick when this source was active

◆ LeftChannelSourceLocation

FVector FSoundSource::LeftChannelSourceLocation
protected

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

◆ LFEBleed

float FSoundSource::LFEBleed
protected

The amount of a sound to bleed to the LFE speaker

◆ LPFFrequency

float FSoundSource::LPFFrequency
protected

What frequency to set the LPF filter to. Note this could be caused by occlusion, manual LPF application, or LPF distance attenuation.

◆ NumChannels

int32 FSoundSource::NumChannels = 0
protected

the number of channels

◆ NumFramesPlayed

int32 FSoundSource::NumFramesPlayed
protected

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

◆ NumTotalFrames

int32 FSoundSource::NumTotalFrames
protected

The total number of frames of audio for the sound wave

◆ Paused

uint8 FSoundSource::Paused
protected

Whether or not we are actually paused.

◆ Pitch

float FSoundSource::Pitch
protected

The pitch of the sound source.

◆ PlaybackTime

float FSoundSource::PlaybackTime
protected

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

◆ Playing

FThreadSafeBool FSoundSource::Playing
protected

Whether we are playing or not.

◆ RightChannelSourceLocation

FVector FSoundSource::RightChannelSourceLocation
protected

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

◆ StartFrame

int32 FSoundSource::StartFrame
protected

The frame we started on.

◆ TickCount

int32 FSoundSource::TickCount
protected

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

◆ VoiceId

uint32 FSoundSource::VoiceId
protected

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

◆ WaveInstance

FWaveInstance* FSoundSource::WaveInstance
protected

Contained wave instance.


The documentation for this class was generated from the following files: