#include "IntelSoundComponent.h"
#include "Paths.h"
#include "FileManager.h"
#include "Runtime/Engine/Classes/Sound/SoundWave.h"
bool exists;
FString dir, soundDir;
TArray<FString> soundFiles;
// Sets default values for this component's properties
UIntelSoundComponent::UIntelSoundComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
//Empty soundFiles TArray. Easiest way if new wave files are added.
soundFiles.Empty();
//the way Unreal Engine calls the project's root directory
dir = FPaths::ProjectDir();
//Combining Root with the folder location for the sounds.
//This could probably be an external folder if needed with the help of ( IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile(); )
soundDir = dir + "Content/Sounds";
//UE4 returns a bool if the directory exists or not.
exists = FPaths::DirectoryExists(soundDir);
}