Hi. I have a requirement which used FMODCoreAPI and FMODStudioAPI:GlobalMasterGroup has 16 channels output.It works well when i just play one sound has 8 channels output.But once i load a bank which MasterGroupBus output mode is set as 5.1channels, my sound will downmix automaticly to 5.1 mode.
FMOD::Studio::System::create(&system);
system->getCoreSystem(&core_system);
core_system->setSoftwareFormat(48000, FMOD_SPEAKERMODE_RAW, 16);
system->initialize(1024, FMOD_STUDIO_INIT_NORMAL, FMOD_INIT_PROFILE_ENABLE | FMOD_INIT_PROFILE_METER_ALL, NULL);
core_system->createChannelGroup(“test”, &channelgroup);
core_system->createSound(“D:/project/FMod_Test/Debug/8channelstest.wav”, FMOD_LOOP_NORMAL, NULL, &sound);
core_system->playSound(sound, channelgroup, false, &channel);
system->update();
till now works well:
FMOD::Studio::Bank *bank;
system->loadBankFile(“D:/project/FMod_Test/Debug/wavebanks/Master.bank”, FMOD_STUDIO_LOAD_BANK_NORMAL, &bank);
system->loadBankFile(“D:/project/FMod_Test/Debug/wavebanks/Master.strings.bank”, FMOD_STUDIO_LOAD_BANK_NORMAL, &bank);
system->update();
auto downmix occurred:
I tried many methods but it didn’t work.
by setMixMatrix():
core_system->getMasterChannelGroup(&mastergroup);
float matrix[16][16] = { 0 };
for (int i = 0; i < 16; i++) matrix[i][i] = 1;
mastergroup->setMixMatrix(matrix[0], 16, 16);
or add a dsp in MasterChannelgroup with readDSP callback:
strcpy(dspdesc.name, “test_dsp”);
dspdesc.version = FMOD_PLUGIN_SDK_VERSION;
dspdesc.numinputbuffers = 16;
dspdesc.numoutputbuffers = 16;
dspdesc.read = readDSP;
core_system->createDSP(&dspdesc, &dsp);
mastergroup->addDSP(1, dsp);
FMOD_RESULT F_CALLBACK readDSP(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels)
{
memcpy(outbuffer, inbuffer, length * sizeof(float) * inchannels);
return FMOD_OK;
}
still not working:
I can reset studio MasterGroupBus output mode to make it work correctly, but is there any other way to config channel.
Thanks.