How to save 3D sound effects to wav files?


#1

I designed a 3D sound effect, but the audio I saved is different from the one I previewed. How should I save the 3D sound effect?Here is the code I initialized to save:

void FMODCore::saveInit3D(char *inputPath, char *outPath) {
FMOD_RESULT result;
result = system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER_NRT);
ERRCHECK(result);
result = system->setSoftwareFormat(24000, FMOD_SPEAKERMODE_DEFAULT, 10);
ERRCHECK(result);
result = system->init(32, FMOD_INIT_NORMAL, (void *) outPath);
ERRCHECK(result);
result = system->set3DSettings(1.0, DISTANCEFACTOR, 1.0f);
ERRCHECK(result);
result = system->createSound(inputPath, FMOD_3D, 0, &sound);
ERRCHECK(result);
result = sound->set3DMinMaxDistance(0.5f * DISTANCEFACTOR, 5000.0f * DISTANCEFACTOR);
ERRCHECK(result);
}


#2

How is the sound different?


#3

The listener’s speed, position, and direction of movement are different from what I set.
I solved this problem by using real-time save, but it was time-consuming.
Can 3D effects be saved using NRT?