Upgrading from 1.09.06 to 1.10.04 - Broken Programmer Sounds

I just upgraded my FMOD and came across various compatibility problems, first of all EventInstance is now a struct and I used to compare it to null in quite a few places, can instance.“isValid()” be used as a work around?

Also I followed this example to set up my pogrammer sounds

I solved the EVENT_CALLBACK problem changing, it to receive the EventInstance instead of it’s pointer but I still have problems with Sound not receicing a point on it’s constructor anymore and missing the getRaw function.

example of broken code:

var parameter = (PROGRAMMER_SOUND_PROPERTIES)Marshal.PtrToStructure(parameterPtr, typeof(PROGRAMMER_SOUND_PROPERTIES));
SOUND_INFO dialogueSoundInfo;

                    RESULT keyResult;

                    if (key == null)
                        keyResult = RuntimeManager.StudioSystem.getSoundInfo(parameter.name, out dialogueSoundInfo);
                        keyResult = RuntimeManager.StudioSystem.getSoundInfo(key, out dialogueSoundInfo);

                    if (keyResult != RESULT.OK)

                    Sound dialogueSound;
                    var soundResult = RuntimeManager.LowlevelSystem.createSound(dialogueSoundInfo.name_or_data, dialogueSoundInfo.mode, ref dialogueSoundInfo.exinfo, out dialogueSound);
                    if (soundResult == RESULT.OK)
                        parameter.sound = dialogueSound.getRaw();// There's no getRaw()
                        parameter.subsoundIndex = dialogueSoundInfo.subsoundindex;
                        Marshal.StructureToPtr(parameter, parameterPtr, false);
                    var parameter = (PROGRAMMER_SOUND_PROPERTIES)Marshal.PtrToStructure(parameterPtr, typeof(PROGRAMMER_SOUND_PROPERTIES));
                    var sound = new Sound(parameter.sound);//No param allowed

What’s the alternative for Sound.GetRaw() so I can pass it into my PROGRAMMER_SOUND_PROPERTIES.sound? And what property was previously set when I passed a point on Sound constructor? So I can try creating a new one and setting the soundPtr afterwards.

I would recommend using this link below, the one you referred to is out of date for 1.10.

The GetRaw function has been replaced with a ‘handle’ member variable.
The previous constructor took in an IntPtr, which as you suggested, you will need to set after creation if you want to overwrite it.

1 Like