I’m trying to play programmer sounds in Web GL build. However, when the DialogueEventCallback is called and I try to get user data from event instance received, it returns ERR_INVALID_HANDLE.
After having some research, I have found that the event instance received has the following issues:
In 1.10.11: instance.hasHandle() is true but instance.isValid() is false
In 2.00.02: instance.hasHandle() is false
(Both versions are tested in an stripped project with minimal assets and code.)
I wonder if programmer sound is supported on Web GL.
But the problem does not exist in PC or Android though. (We tested these 2 platforms)
Which is why we were very puzzled when the same code causes this problem in WebGL build
This appears to be due to us using an apparently unsupported marshaling behavior and we have not found an easy solution for it.
The best solution here is (unfortunately) replacing all the cases of EventInstance in the callback code with IntPtr. This means the you will need to create an instance of our EventInstance wrapper and set the internal handle manually. We currently plan to implement this in FMOD 2.01 as changing it in 2.00 would affect all the current users if they were to update.