0
0

Hey, I’m relatively new to programming but have been coping just fine until now. I’m using FMOD in Unity and it has been working pretty well. Only problem is, I need DSP effects I’m adding to all my events to apply to Reverb , which I understand is achieved by setting the event property by index. As I’ve only been programming in Unity I have never had to use pointers and, from what I’ve seen from other people’s posts, I’d have to use the IntPtr type.

Could anyone give me an idea of how to do this? It seems like such a simple thing to need, I don’t know why it can’t just be selected in Designer I know it will be something along these lines:

[code:1in3toyi]result = Thing.setPropertyByIndex((1)FMOD.EVENTPROPERTY.EFFECTS_AFFECT_REVERB, [b]IntPtr[/b], true);[/code:1in3toyi]

"Thing" is the variable holding FMOD.Event. Obviously something else needs to go where [b:1in3toyi]IntPtr[/b:1in3toyi] is but I’m not really sure what.

Any ideas? Oh, and due to certain restrictions I’m using version 4.25.08. I can’t really change version at this stage so please don’t suggest that.

Thanks!

  • You must to post comments
0
0

Is this not possible / too difficult to explain? If it is just let me know as I might just need to bake all my Reverberated sounds.

  • You must to post comments
0
0

Ah yeah, that’s not a bad idea using reverb per event. Just hope it doesn’t slow everything down too much. Turns out unsafe code is only doable with the expensive version of the Unity engine so it was a bit of a non starter. Thanks for the reply though :-)

  • You must to post comments
0
0

Hi grammo,

If you want a better understanding of how to use IntPtrs in C# with FMOD, take a look at some of the FMOD C# Examples that ship with the FMOD API. Alternatively you could just add a reverb DSP in designer (it would be undesirable in normal circumstances but if it’s just a demo it should be OK).

  • You must to post comments
0
0

You don’t have to do unsafe, another option is:

IntPtr value = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(value, 1);

… setProperty …

Marshal.FreeHGlobal(value);

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.