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 | ( | const FObjectInitializer & | ObjectInitializer | ) |
Create and initialize a new instance.
| ObjectInitializer | Initialization parameters. |
|
overridevirtual |
Activates the SceneComponent, should be overridden by native child classes.
| bReset | - Whether the activation should happen even if ShouldActivate returns false. |
重载 UActorComponent .
| bool UMediaSoundComponent::BP_GetAttenuationSettingsToApply | ( | FSoundAttenuationSettings & | OutAttenuationSettings | ) |
Get the attenuation settings based on the current component settings.
| OutAttenuationSettings | Will contain the attenuation settings, if available. |
| UMediaPlayer * UMediaSoundComponent::GetMediaPlayer | ( | ) | const |
Get the media player that provides the audio samples.
|
protected |
Get the attenuation settings based on the current component settings.
|
overridevirtual |
Called when a component is unregistered.
Called after DestroyRenderState_Concurrent and OnDestroyPhysicsState are called.
重载 USceneComponent .
|
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 .
|
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 .
| void UMediaSoundComponent::SetMediaPlayer | ( | UMediaPlayer * | NewMediaPlayer | ) |
Set the media player that provides the audio samples.
| NewMediaPlayer | The player to set. |
|
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 .
|
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.
| 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.
| 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.