Skip to main content
GameDev.net gamedev.net
🔒 Locked

FMOD C# api crash

Started by hojjatjafary Jan 3, 2014 at 12:44 PM 0 replies 2.9k views
Original Post
hojjatjafary
hojjatjafary

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?

hojjatjafary
hojjatjafary

Found my solution, I was iterating through a generic List of string containing music cue names to get cue iterator, a List 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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.