Hi Cindy, it definitely works, just needs a little bit of porting.
This is what I used to register it before init. (you dont need to make a dll, you can use registerOutput inside your code).
unsigned int outputhandle;
result = gSystem->registerOutput(FMODGetOutputDescription(), &outputhandle);
ERRCHECK(result);
Next, the getDriverCaps functions is gone, so remove that
Next, getDriverName is replaced with getDriverInfo so use that instead
ie
FMOD_RESULT F_CALLBACK OutputMP3_GetNumDriversCallback(FMOD_OUTPUT_STATE *output, int *numdrivers);
//FMOD_RESULT F_CALLBACK OutputMP3_GetDriverNameCallback(FMOD_OUTPUT_STATE *output, int id, char *name, int namelen);
FMOD_RESULT F_CALLBACK OutputMP3_GetDriverNameCallback(FMOD_OUTPUT_STATE *output, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
//FMOD_RESULT F_CALLBACK OutputMP3_InitCallback(FMOD_OUTPUT_STATE *output, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, int outputchannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, const void *hwnd);
Next, init footprint changed a bit, so
//FMOD_RESULT F_CALLBACK OutputMP3_InitCallback(FMOD_OUTPUT_STATE *output, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, int outputchannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, const void *hwnd)
FMOD_RESULT F_CALLBACK OutputMP3_InitCallback(FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata)
{
outputmp3_state *state;
BE_CONFIG beConfig = {0,};
BE_ERR err = 0;
char filename[256];
*speakermode = FMOD_SPEAKERMODE_STEREO;
*speakermodechannels = 2;
This forces the output mode to the format you want, rather than the error check. If you set 5.1 it should automatically downmix to stereo if the output says it is stereo.
Apart from this, i had to cast a few things to get it to compile, but it worked fine and produced an mp3.
Note that this plugin will crash the program if it requests 1152 samples and the mixer is set to 1024 or any other block size. The app will have to force the dspbuffersize (with System::setDSPBufferSize) to 1152 in this case to get the blocks to line up.
The plugin is supposed to respect whatever the user wants, so the plugin should really be doing some buffering here. I’ll look at adding it and adding the output_mp3 example to the windows plugin_dev example folder for Studio.