Answered
0
0

Trying to play midi file using custom sound bank, I’m supposed to pass path to .dls file via FMOD.CREATESOUNDEXINFO.dlsname but it’s a IntPtr not a string.

tried this but it doesn’t work

IntPtr pathInt = Marshal.StringToHGlobalUni(Utils.dataPath + "gm.dls");
    info.dlsname = pathInt;
    info.cbsize = Marshal.SizeOf(info);
    FMOD.Sound sound;
    lowSys.createStream(Utils.dataPath + "errors.mid", FMOD.MODE.DEFAULT, ref info, out sound);        
    FMOD.Channel channel;
    lowSys.playSound(sound, null, false, out channel);
    Marshal.FreeHGlobal(pathInt);

in fmod log I can see this eror, looks like it got only first letter of filename?
http://imgur.com/a/3QtmG

  • laggyluk

    StringToHGlobalAnsi works better, no error in log anymore but still silence on android

  • You must to post comments
Best Answer
0
0

Marshal.StringToHGlobalAnsi is a fix, didn’t play anything because for some reason my StreamingAssets folder didn’t get copied over to device

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.