5#include "CoreMinimal.h"
9class UImportedSoundWave;
24#pragma region public API
39 TWeakPtr<Audio2FaceRESTHandler> A2FRestHandler,
71 template <
typename T,
typename = std::enable_if_t<std::is_base_of_v<ILipSyncBaseData, T>>>
74 return StaticCast<const T*>(m_lipSyncData);
98 const FString FULL_DOWNLOAD_URL;
101 TArray<uint8> m_rawAudioData;
102 TWeakPtr<Audio2FaceRESTHandler> m_A2FRestHandler =
nullptr;
106 UImportedSoundWave* m_soundWave =
nullptr;
110#pragma region private API
116 void ProcessAudioData();
123 void GenerateLipSync();
LipSyncType
LipSyncType All the possible LipSync types that are currently supported by the UnrealVoxta client.
Definition LipSyncType.h:21
MessageChunkState
MessageChunkState All the possible states that an instance of MessageChunkAudioContainer could be in.
Definition MessageChunkState.h:16
@ Idle
Definition MessageChunkState.h:17
Audio2FaceRESTHandler Manages the HTTP REST API for A2F_headless mode.
Definition Audio2FaceRESTHandler.h:18
ILipSyncBaseData Interface for lipsync data containers.
Definition LipSyncBaseData.h:25
MessageChunkState GetCurrentState() const
Definition MessageChunkAudioContainer.cpp:82
void Continue()
Advance the internal state machine to the next processing step (download, decode, lipsync,...
Definition MessageChunkAudioContainer.cpp:29
virtual ~MessageChunkAudioContainer()=default
MessageChunkAudioContainer(const FString &fullUrl, LipSyncType lipSyncType, TWeakPtr< Audio2FaceRESTHandler > A2FRestHandler, TFunction< void(const MessageChunkAudioContainer *newState)> callback, int id)
Construct a new MessageChunkAudioContainer for a specific audio chunk.
Definition MessageChunkAudioContainer.cpp:17
const T * GetLipSyncData() const
Get an immutable pointer to the lipsync data object for this chunk, cast to the requested type.
Definition MessageChunkAudioContainer.h:72
const TArray< uint8 > & GetRawAudioData() const
Get a reference to the raw audio data bytes for this chunk.
Definition MessageChunkAudioContainer.cpp:77
const int INDEX
The index of this sound asset in the collection of the VoxtaAudioPlayback.
Definition MessageChunkAudioContainer.h:92
UImportedSoundWave * GetSoundWave() const
Definition MessageChunkAudioContainer.cpp:87
const LipSyncType LIP_SYNC_TYPE
The type of lipsync that this voiceline instance will support with its data.
Definition MessageChunkAudioContainer.h:95
void CleanupData()
Clean up all dynamically created objects and data, and mark this chunk as cleaned up.
Definition MessageChunkAudioContainer.cpp:59