I have been trying to play a song from a byte array now(format .xm). since I’m playing from a byte array I need an CREATESOUNDEXINFO object reference as a parameter. I have tried specifying different thing on the CREATESOUNDEXINFO object I have made, but I still get the same error from createsound; ERR_INVALID_PARAM.
Can anyone tell me what to do with the CREATESOUNDEXINFO object or something to be able to play from a byte array?
btw I’m using Visual studio .net and coding in C#
- ConfidentiaL asked 12 years ago
Here’s C# code that I use to load a sound file from a memory resource:
[code:1e1ry7lr] private void Load()
if (sound == null)
System.IO.Stream fmodrc = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(this.GetType().Name + ".bin");
byte buf = new byte[fmodrc.Length];
fmodrc.Read(buf, 0, (int)fmodrc.Length);
FMOD.CREATESOUNDEXINFO sndinf = new FMOD.CREATESOUNDEXINFO();
sndinf.cbsize = System.Runtime.InteropServices.Marshal.SizeOf(sndinf);
sndinf.length = (uint)buf.Length;
ERRCHECK(system.createSound(buf, FMOD.MODE.OPENMEMORY, ref sndinf, ref sound));
- bluemonkmn answered 11 years ago
Please login first to submit.