void FAkAudioModule::StartupModule()
{
if (AkAudioModuleIntance)
return;
AkAudioModuleIntance = this;
#if WITH_EDITOR
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
auto initBankPath = FString::Printf(TEXT("%s/InitBank"), *AkUnrealHelper::GetBaseAssetPackagePath());
FString initBankFileName;
TArray<FString> paths;
if (FPackageName::TryConvertLongPackageNameToFilename(initBankPath, initBankFileName, FPackageName::GetAssetPackageExtension()))
{
paths.Add(initBankFileName);
}
AssetRegistryModule.Get().ScanFilesSynchronous(paths, false);
#endif
AkAudioDevice = new FAkAudioDevice;
if (!AkAudioDevice)
return;
FAkWaapiClient::Initialize();
if (!AkAudioDevice->Init())
{
delete AkAudioDevice;
AkAudioDevice = nullptr;
return;
}
OnTick = FTickerDelegate::CreateRaw(AkAudioDevice, &FAkAudioDevice::Update);
TickDelegateHandle = FTicker::GetCoreTicker().AddTicker(OnTick);
FAkWaapiClient::Initialize();
FAkAudioStyle::Initialize();
}