Files
UE5-cyberHuman/Plugins/AzSpeech/Source/AzSpeechEditor/Private/Generator/AzSpeechPropertiesGetter.cpp

41 lines
916 B
C++
Raw Normal View History

2025-04-07 18:31:41 -07:00
// Author: Lucas Vilas-Boas
// Year: 2023
// Repo: https://github.com/lucoiso/UEAzSpeech
#include "AzSpeechPropertiesGetter.h"
#ifdef UE_INLINE_GENERATED_CPP_BY_NAME
#include UE_INLINE_GENERATED_CPP_BY_NAME(AzSpeechPropertiesGetter)
#endif
UAzSpeechPropertiesGetter::UAzSpeechPropertiesGetter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
}
void UAzSpeechPropertiesGetter::OnAvailableVoicesChanged(const TArray<FString>& Voices)
{
OnAvailableVoicesUpdated.ExecuteIfBound(Voices);
Destroy();
}
void UAzSpeechPropertiesGetter::SynthesisCompleted(const TArray<uint8>& AudioData)
{
OnAudioDataGenerated.ExecuteIfBound(AudioData);
Destroy();
}
void UAzSpeechPropertiesGetter::TaskFail()
{
Destroy();
}
void UAzSpeechPropertiesGetter::Destroy()
{
ClearFlags(RF_Standalone);
#if ENGINE_MAJOR_VERSION >= 5
MarkAsGarbage();
#else
MarkPendingKill();
#endif
}