engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Public 属性 | Protected 成员函数 | Protected 属性 | 所有成员列表
UMediaSoundComponent类 参考

Implements a sound component for playing a media player's audio output. 更多...

#include <MediaSoundComponent.h>

继承自 USynthComponent .

Public 成员函数

virtual void Activate (bool bReset=false) override
 Activates the SceneComponent, should be overridden by native child classes. 更多...
 
bool BP_GetAttenuationSettingsToApply (FSoundAttenuationSettings &OutAttenuationSettings)
 Get the attenuation settings based on the current component settings. 更多...
 
virtual void Deactivate () override
 Deactivates the SceneComponent.
 
float GetEnvelopeValue () const
 Retrieves the current amplitude envelope.
 
UMediaPlayer * GetMediaPlayer () const
 Get the media player that provides the audio samples. 更多...
 
TArray< FMediaSoundComponentSpectralData > GetNormalizedSpectralData ()
 Retrieves and normalizes the spectral data if spectral analysis is enabled.
 
TArray< FMediaSoundComponentSpectralData > GetSpectralData ()
 Retrieves the spectral data if spectral analysis is enabled.
 
virtual void OnRegister () override
 Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called.
 
virtual void OnUnregister () override
 Called when a component is unregistered. 更多...
 
virtual void PostInitProperties () override
 Called after the C++ constructor and after the properties have been initialized, including those loaded from config. 更多...
 
virtual void PostLoad () override
 Do any object-specific cleanup required immediately after loading an object. 更多...
 
void SetEnableEnvelopeFollowing (bool bInEnvelopeFollowing)
 Turns on amplitude envelope following the audio in the media sound component.
 
void SetEnableSpectralAnalysis (bool bInSpectralAnalysisEnabled)
 Turns on spectral analysis of the audio generated in the media sound component.
 
void SetEnvelopeFollowingsettings (int32 AttackTimeMsec, int32 ReleaseTimeMsec)
 Sets the envelope attack and release times (in ms).
 
void SetMediaPlayer (UMediaPlayer *NewMediaPlayer)
 Set the media player that provides the audio samples. 更多...
 
void SetSpectralAnalysisSettings (TArray< float > InFrequenciesToAnalyze, EMediaSoundComponentFFTSize InFFTSize=EMediaSoundComponentFFTSize::Medium_512)
 Sets the settings to use for spectral analysis.
 
virtual void TickComponent (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
 Function called every frame on this ActorComponent. 更多...
 
 UMediaSoundComponent (const FObjectInitializer &ObjectInitializer)
 Create and initialize a new instance. 更多...
 
 ~UMediaSoundComponent ()
 Virtual destructor.
 

Public 属性

EMediaSoundChannels Channels
 Media sound channel type.
 
bool DynamicRateAdjustment
 Dynamically adjust the sample rate if audio and media clock desynchronize.
 
float RateAdjustmentFactor
 Factor for calculating the sample rate adjustment. 更多...
 
FFloatRange RateAdjustmentRange
 The allowed range of dynamic rate adjustment. 更多...
 

Protected 成员函数

const FSoundAttenuationSettings * GetSelectedAttenuationSettings () const
 Get the attenuation settings based on the current component settings. 更多...
 

Protected 属性

UMediaPlayer * MediaPlayer
 The media player asset associated with this component. 更多...
 

详细描述

Implements a sound component for playing a media player's audio output.

构造及析构函数说明

◆ UMediaSoundComponent()

UMediaSoundComponent::UMediaSoundComponent ( const FObjectInitializer &  ObjectInitializer)

Create and initialize a new instance.

参数
ObjectInitializerInitialization parameters.

成员函数说明

◆ Activate()

virtual void UMediaSoundComponent::Activate ( bool  bReset = false)
overridevirtual

Activates the SceneComponent, should be overridden by native child classes.

参数
bReset- Whether the activation should happen even if ShouldActivate returns false.

重载 UActorComponent .

◆ BP_GetAttenuationSettingsToApply()

bool UMediaSoundComponent::BP_GetAttenuationSettingsToApply ( FSoundAttenuationSettings &  OutAttenuationSettings)

Get the attenuation settings based on the current component settings.

参数
OutAttenuationSettingsWill contain the attenuation settings, if available.
返回
true if attenuation settings were returned, false if attenuation is disabled.

◆ GetMediaPlayer()

UMediaPlayer * UMediaSoundComponent::GetMediaPlayer ( ) const

Get the media player that provides the audio samples.

返回
The component's media player, or nullptr if not set.
参见
SetMediaPlayer

◆ GetSelectedAttenuationSettings()

const FSoundAttenuationSettings * UMediaSoundComponent::GetSelectedAttenuationSettings ( ) const
protected

Get the attenuation settings based on the current component settings.

返回
Attenuation settings, or nullptr if attenuation is disabled.

◆ OnUnregister()

virtual void UMediaSoundComponent::OnUnregister ( )
overridevirtual

Called when a component is unregistered.

Called after DestroyRenderState_Concurrent and OnDestroyPhysicsState are called.

重载 USceneComponent .

◆ PostInitProperties()

virtual void UMediaSoundComponent::PostInitProperties ( )
overridevirtual

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

This is called before any serialization or other setup has happened.

重载 UActorComponent .

◆ PostLoad()

virtual void UMediaSoundComponent::PostLoad ( )
overridevirtual

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

This is not called for newly-created objects, and by default will always execute on the game thread.

重载 UActorComponent .

◆ SetMediaPlayer()

void UMediaSoundComponent::SetMediaPlayer ( UMediaPlayer *  NewMediaPlayer)

Set the media player that provides the audio samples.

参数
NewMediaPlayerThe player to set.
参见
GetMediaPlayer

◆ TickComponent()

virtual void UMediaSoundComponent::TickComponent ( float  DeltaTime,
enum ELevelTick  TickType,
FActorComponentTickFunction *  ThisTickFunction 
)
overridevirtual

Function called every frame on this ActorComponent.

Override this function to implement custom logic to be executed every frame. Only executes if the component is registered, and also PrimaryComponentTick.bCanEverTick must be set to true.

参数
DeltaTime- The time since the last tick.
TickType- The kind of tick this is, for example, are we paused, or 'simulating' in the editor
ThisTickFunction- Internal tick function struct that caused this to run

重载 UActorComponent .

类成员变量说明

◆ MediaPlayer

UMediaPlayer* UMediaSoundComponent::MediaPlayer
protected

The media player asset associated with this component.

This property is meant for design-time convenience. To change the associated media player at run-time, use the SetMediaPlayer method.

参见
SetMediaPlayer

◆ RateAdjustmentFactor

float UMediaSoundComponent::RateAdjustmentFactor

Factor for calculating the sample rate adjustment.

If dynamic rate adjustment is enabled, this number is multiplied with the drift between the audio and media clock (in 100ns ticks) to determine the adjustment. that is to be multiplied into the current playrate.

◆ RateAdjustmentRange

FFloatRange UMediaSoundComponent::RateAdjustmentRange

The allowed range of dynamic rate adjustment.

If dynamic rate adjustment is enabled, and the necessary adjustment falls outside of this range, audio samples will be dropped.


该类的文档由以下文件生成: