5#include "CoreMinimal.h"
7#include "Audio2FacePlaybackHandler.generated.h"
23#pragma region public API
30 void Initialize(UAudioComponent* audioComponent);
54#pragma region UObject overrides
74 UAudioComponent* m_audioComponent =
nullptr;
76 FCriticalSection m_curvesGuard;
78 FDelegateHandle m_playbackPercentHandle;
79 FDelegateHandle m_playbackFinishedHandle;
80 TArray<
float> m_currentCurves;
81 bool m_forcedNeutral = true;
84#pragma region private API
86 void InitNeutralPose();
96 void OnAudioPlaybackPercent(
const UAudioComponent* audioComponent,
const USoundWave* soundWave,
float Percent);
103 void OnAudioPlaybackFinished(UAudioComponent* audioComponent);
UAudio2FacePlaybackHandler Handles synchronization and playback of Audio2Face lipsync data with audio...
Definition Audio2FacePlaybackHandler.h:20
virtual void BeginDestroy() override
Called when the object is being destroyed.
Definition Audio2FacePlaybackHandler.cpp:127
void Initialize(UAudioComponent *audioComponent)
Register the AudioComponent that will be used to sync the A2F lipsync data.
Definition Audio2FacePlaybackHandler.cpp:65
void GetA2FCurveWeights(TArray< float > &targetArrayRef)
Fetch the curve values for the upcoming frame, mapping to the blendshapes of the ARKit.
Definition Audio2FacePlaybackHandler.cpp:76
static const int CURVE_COUNT
Number of ARKit blendshape curves.
Definition Audio2FacePlaybackHandler.h:65
void Play(const ULipSyncDataA2F *lipsyncData)
Begin playback of the A2F lipsync data along with the audio in the AudioComponent.
Definition Audio2FacePlaybackHandler.cpp:89
void Stop()
Stop the playback and return to a lipsync state (closed mouth).
Definition Audio2FacePlaybackHandler.cpp:113
static const FName CURVE_NAMES[CURVE_COUNT]
Names of the ARKit blendshape curves.
Definition Audio2FacePlaybackHandler.h:9
ULipSyncDataA2F UObject-based container for Audio2Face lipsync data.
Definition LipSyncDataA2F.h:18