0
0

hi
first sorry for my bad English
it is my first using FMOD
i try to play byte array of wave file , it is return error "ERR_INVALID_PARAM" and when i try the loadfrommemory example it is return the same error
this is my code

        length = LoadFileIntoMemory("drumloop.wav");
        exinfo.cbsize = Marshal.SizeOf(exinfo);
        exinfo.length = (uint)length;
        result = system.createSound(audiodata, (FMOD.MODE.HARDWARE | FMOD.MODE.OPENMEMORY), ref exinfo, ref sound);

please help my how can i play that byte array , i know that i can pass a file path , but my real project dose not have a file it is only byte array

  • You must to post comments
0
0

The problem is the C# CREATESOUNDEXINFO struct is incorrect, to fix this issue you need to remove the ‘extracodecdata’ member. Once you do this the sizeof will be correct and the params will line up as expected. I will put this fix in our next release but you can make the change locally to fix the issue right away.

Let me know if you have in other issues.

  • You must to post comments
0
0

the loadfrommemory example in c++ is worked but not work in c#
the different was in exinfo.cbsize
in c# is 136
in c++ is 132
when i change exinfo.cbsize to 132 the example work
this is my new code

length = LoadFileIntoMemory("drumloop.wav");
exinfo.cbsize = 132;
exinfo.length = (uint)length;
result = system.createSound(audiodata, (FMOD.MODE.HARDWARE | FMOD.MODE.OPENMEMORY), ref exinfo, ref sound);

but i do not know if it will make other problems ???

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.