Fixed 3d audio #401
|
@ -54,13 +54,42 @@ namespace SHADE
|
|||
|
||||
denseListener = &SHComponentManager::GetDense<SHAudioListenerComponent>();
|
||||
fmodStudioSystem->getCoreSystem(&fmodSystem);
|
||||
fmodSystem->setSoftwareFormat(0, FMOD_SPEAKERMODE_5POINT1, 0);
|
||||
result = fmodStudioSystem->initialize(AUDIO_SYS_MAX_CHANNELS, AUDIO_SYS_MAX_CHANNELS, FMOD_STUDIO_INIT_NORMAL | FMOD_INIT_NORMAL, extraDriverData);
|
||||
|
||||
result = fmodSystem->setSoftwareFormat(0, FMOD_SPEAKERMODE_5POINT1, 0);
|
||||
ErrorCheck();
|
||||
result = fmodSystem->setOutput(FMOD_OUTPUTTYPE_AUDIO3D);
|
||||
if(result != FMOD_OK)
|
||||
{
|
||||
result = fmodSystem->setOutput(FMOD_OUTPUTTYPE_WINSONIC);
|
||||
if (result == FMOD_OK)
|
||||
{
|
||||
result = fmodSystem->setSoftwareFormat(0, FMOD_SPEAKERMODE_7POINT1POINT4, 0);
|
||||
ErrorCheck();
|
||||
}
|
||||
}
|
||||
|
||||
int numDrivers{};
|
||||
result = fmodSystem->getNumDrivers(&numDrivers);
|
||||
if(numDrivers == 0)
|
||||
{
|
||||
fmodSystem->setDSPBufferSize(512, 4);
|
||||
fmodSystem->setOutput(FMOD_OUTPUTTYPE_AUTODETECT);
|
||||
}
|
||||
FMOD_OUTPUTTYPE outputType = FMOD_OUTPUTTYPE_WINSONIC;
|
||||
fmodSystem->getSoftwareFormat(0, &speakerMode, 0);
|
||||
fmodSystem->getOutput(&outputType);
|
||||
|
||||
FMOD_STUDIO_INITFLAGS studioInitFlags = FMOD_STUDIO_INIT_NORMAL;
|
||||
FMOD_INITFLAGS coreInitFlags = FMOD_INIT_NORMAL | FMOD_INIT_3D_RIGHTHANDED | FMOD_INIT_PREFER_DOLBY_DOWNMIX;
|
||||
#ifdef _DEBUG
|
||||
studioInitFlags |= FMOD_STUDIO_INIT_LIVEUPDATE;
|
||||
coreInitFlags |= FMOD_INIT_PROFILE_ENABLE;
|
||||
#endif
|
||||
|
||||
result = fmodStudioSystem->initialize(AUDIO_SYS_MAX_CHANNELS, studioInitFlags, coreInitFlags, extraDriverData);
|
||||
|
||||
ErrorCheck();
|
||||
|
||||
fmodSystem->setSoftwareFormat(0, speakerMode, 0);
|
||||
|
||||
result = fmodSystem->createChannelGroup("SFX", &sfxChannelGroup);
|
||||
ErrorCheck();
|
||||
|
||||
|
|
Loading…
Reference in New Issue