FMOD C# api crash

Started by
0 comments, last by hojjatjafary 10 years, 3 months ago

Hi,
I'm trying to implement an interactive music system using FMOD Designer C# api, I used the event system without any problem, but when I try to get music cues it crashes.


    FMOD.RESULT result;
    ERRCHECK(result = eventsystem.getMusicSystem(ref musicSystem));
     
    FMOD.MUSIC_ITERATOR iter = new FMOD.MUSIC_ITERATOR();
     
    ERRCHECK(musicSystem.getCues(ref iter, "myFilter"));     // Crash !!!

Is there anyone master in P/Invoke that can help me to find a solution to this annoying problem?

Advertisement

Found my solution, I was iterating through a generic List of string containing music cue names to get cue iterator, a List<string> musicCueNames, like this :


ERRCHECK(musicSystem.getCues(ref iter, musicCueNames[i])); // Crash!

I changed it to something like this :



string cueName = musicCueNames[i];
ERRCHECK(musicSystem.getCues(ref iter, cueName)); // Works!

and now everything works properly, but don't know exactly why.

This topic is closed to new replies.

Advertisement