Enabling 7.1.4 in UE4

Hi,

As I looked on your responses in different topics, there is no official support for 7.1.4 system in UE4 plugin.

However, I’d like to ask:
Is it ok if I add the option to use 7.1.4 in the plugin myself?

What I mean is that I’ve looked into the plugin code and I’ve noticed that there is FMOD_SPEAKERMODE available for that:

typedef enum FMOD_SPEAKERMODE
{
    FMOD_SPEAKERMODE_DEFAULT,
    FMOD_SPEAKERMODE_RAW,
    FMOD_SPEAKERMODE_MONO,
    FMOD_SPEAKERMODE_STEREO,
    FMOD_SPEAKERMODE_QUAD,
    FMOD_SPEAKERMODE_SURROUND,
    FMOD_SPEAKERMODE_5POINT1,
    FMOD_SPEAKERMODE_7POINT1,
    FMOD_SPEAKERMODE_7POINT1POINT4, //HERE

    FMOD_SPEAKERMODE_MAX,
    FMOD_SPEAKERMODE_FORCEINT = 65536
} FMOD_SPEAKERMODE;

So I changed FMODSettings.h and FMODSettings.generated.h to include it:

UENUM()
namespace EFMODSpeakerMode
{
enum Type
{
    // The speakers are stereo
    Stereo,
    // 5.1 speaker setup
    Surround_5_1,
    // 7.1 speaker setup
    Surround_7_1,
    Surround_7_1_4 //<----HERE
};
}
#define FOREACH_ENUM_EFMODSPEAKERMODE(op) \
	op(EFMODSpeakerMode::Stereo) \
	op(EFMODSpeakerMode::Surround_5_1) \
	op(EFMODSpeakerMode::Surround_7_1) \
	op(EFMODSpeakerMode::Surround_7_1_4)  //<----HERE

And also put the speaker mode to be changed in ConvertSpeakerMode

inline FMOD_SPEAKERMODE ConvertSpeakerMode(EFMODSpeakerMode::Type Mode)
{
    switch (Mode)
    {
        case EFMODSpeakerMode::Stereo:
            return FMOD_SPEAKERMODE_STEREO;
        case EFMODSpeakerMode::Surround_5_1:
            return FMOD_SPEAKERMODE_5POINT1;
        case EFMODSpeakerMode::Surround_7_1:
            return FMOD_SPEAKERMODE_7POINT1;
        case EFMODSpeakerMode::Surround_7_1_4: //<----HERE
            return FMOD_SPEAKERMODE_7POINT1POINT4;
        default:
            check(0);
            return FMOD_SPEAKERMODE_DEFAULT;
    };
}

Thanks to that, I was able to change the option in the project settings:
image

I tested it for a short period of time and nothing exploded.

Do you think it is ok to do it this way, enabling the output format in the code like this? You probably need testing for this feature before it is officially supported, but I’d like to know if you think this is a good way to do it or should I wait for official support.

That should largely get the job done, the only other requirement to supporting 7.1.4 is switching to a 7.1.4 aware output plugin, i.e. System::setOutput(FMOD_OUTPUTTYPE_WINSONIC).

Thanks! Will try it when I can, because it turned out that I don’t need 7.1.4 in my project, yet, so it’s not that of a big problem.

And sorry for the long reply.