Hello guys, i have a custom class that lets me interface with a third party library.
It’s declared this way (i simplifyed tons of stuffs and omitted some too):
PocketSphinxWrapper.h
UCLASS(Config = Game, Abstract, Within = PlayerController)
class UPocketSphinxWrapper : public UObject, public EventGrabber
{
GENERATED_UCLASS_BODY()
public:
virtual ~UPocketSphinxWrapper();
};
pocketSphinxWrapper.cpp
UPocketSphinxWrapper::UPocketSphinxWrapper(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
, m_VoiceCapture(NULL)
, m_IsRecording(false)
{
FString hmm = FPaths::ConvertRelativePathToFull(FPaths::GameDir()) + TEXT(MODELDIR) + TEXT("/hmm/voxforge_en_0_1_3");
FString dict = FPaths::ConvertRelativePathToFull(FPaths::GameDir()) + TEXT(MODELDIR) + TEXT("/dict/repair.dic");
FString keywords = FPaths::ConvertRelativePathToFull(FPaths::GameDir()) + TEXT(MODELDIR) + TEXT("/dict/keywords.txt");
UE_LOG(LogTemp, Warning, TEXT("hmm location is %s"), *hmm);
UE_LOG(LogTemp, Warning, TEXT("dict location is %s"), *dict);
[...]
UE_LOG(LogTemp, Warning, TEXT("INIT POCKETSPHINX: r1 = %d - r2 = %d"), r1, r2);
UE_LOG(LogTemp, Warning, TEXT("Keywords are: %s"), UTF8_TO_TCHAR(ps_get_kws(m_Ps, TESTSESSIONNAME)));
}
The problem arises from the fact that i’m still not using this class (no references, instances or whatsoever), however when i launch the editor i see this class’s constructor log lines come out, so i suppose it gets instaced somewhere.
Since it interfaces with the voice module, and it will be quite hungry of resources, i’m quite concerned.
Does this happen just in the editor, and why?
I mean: will there be any “extra” instaced object that i don’t know about in the shipped game, or this happens just in the editor?
Thanks id advance for your time.