Hi!
We’ve been using FMOD for recording in an UE4 application, and we recently moved from 4.12 to 4.14. In 4.12, we used to retrieve the available recording devices from the PlayerController’s BeginPlay function using
StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
FMOD::System* System;
check(StudioSystem->getLowLevelSystem(&System) == FMOD_OK);int NumDrivers, NumDevices;
System->getRecordNumDrivers(&NumDrivers, &NumDevices);
This always gave us the correct amount of recording devices available. However, since we upgraded UE and FMOD to 4.14, both NumDrivers and NumDevices would always be 0 at this point.
After some more testing, I found out they do become available, but only after running the application for over 1 second. I tested this by repeatedly using the above code in the Tick function.
Is this expected, and am I missing a new step required in 4.14?
edit:
To verify this is not caused by my local project, I’ve set up a new UE4.14 project (blank C++ project), and added this simple code to the implementation file of the standard GameModeBase class:
AFMODMicGameModeBase::AFMODMicGameModeBase()
{
PrimaryActorTick.bCanEverTick = true;
}
void Test()
{
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
FMOD::System* System;
check(StudioSystem->getLowLevelSystem(&System) == FMOD_OK);
int NumDrivers, NumDevices;
System->getRecordNumDrivers(&NumDrivers, &NumDevices);
UE_LOG(LogTemp, Warning, TEXT("Drivers: %i Devices: %i"), NumDrivers, NumDevices);
}
void AFMODMicGameModeBase::BeginPlay()
{
Super::BeginPlay();
Test();
}
void AFMODMicGameModeBase::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
Test();
}
The behavior is the same in this project, the drivers and devices only show up after about 1.2 seconds.