# Upgrading from 1.09.06 to 1.10.04 - Broken Programmer Sounds

**URL:** <https://qa.fmod.com/t/upgrading-from-1-09-06-to-1-10-04-broken-programmer-sounds/13769>\
**Category:** Unity\
**Created:** [March 19, 2018, 5:33pm UTC](https://qa.fmod.com/t/upgrading-from-1-09-06-to-1-10-04-broken-programmer-sounds/13769 "2018-03-19T17:33:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caiorosisca](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/caiorosisca/32/3829_2.png) [@caiorosisca](https://qa.fmod.com/u/caiorosisca)\
**Post date:** [March 19, 2018, 5:33pm UTC](https://qa.fmod.com/t/upgrading-from-1-09-06-to-1-10-04-broken-programmer-sounds/13769/1 "2018-03-19T17:33:01Z")

</div>

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  
[https://www.fmod.org/documentation/#content/generated/engine\_new\_unity/script\_example\_programmersounds.html](https://www.fmod.org/documentation/#content/generated/engine_new_unity/script_example_programmersounds.html)

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:

case EVENT\_CALLBACK\_TYPE.CREATE\_PROGRAMMER\_SOUND:  
{  
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);
                    else
                        keyResult = RuntimeManager.StudioSystem.getSoundInfo(key, out dialogueSoundInfo);

                    if (keyResult != RESULT.OK)
                        break;

                    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);
                    }
                }
                break;
            case EVENT_CALLBACK_TYPE.DESTROY_PROGRAMMER_SOUND:
                {
                    var parameter = (PROGRAMMER_SOUND_PROPERTIES)Marshal.PtrToStructure(parameterPtr, typeof(PROGRAMMER_SOUND_PROPERTIES));
                    var sound = new Sound(parameter.sound);//No param allowed
                    sound.release();
                }

```

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.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [March 20, 2018, 9:56pm UTC](https://qa.fmod.com/t/upgrading-from-1-09-06-to-1-10-04-broken-programmer-sounds/13769/2 "2018-03-20T21:56:29Z")

</div>

I would recommend using this link below, the one you referred to is out of date for 1.10.  
[https://fmod.com/resources/documentation-api?page=content/generated/engine\_new\_unity/script\_example\_programmersounds.html#/](https://fmod.com/resources/documentation-api?page=content/generated/engine_new_unity/script_example_programmersounds.html#/)

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.
