0
0

Hi,

Midi file plays fine with default windows dls using: [code:188qaps3]result = system.createSound("../../../../../examples/media/test.mid", (FMOD.MODE._2D | FMOD.MODE.HARDWARE | FMOD.MODE.CREATESTREAM), ref sound);
ERRCHECK(result);[/code:188qaps3]

But when I’m trying to test DLS loading I keep getting:
"FMOD Error! ERR_INVLAID_PARM an invalid param was passed to this function."

code is:

[code:188qaps3]FMOD.CREATESOUNDEXINFO exinfo = new FMOD.CREATESOUNDEXINFO();
exinfo.dlsname = "../../../../../examples/media/sfx.dls";
FMOD.MODE.CREATESTREAM), ref sound);
result = system.createSound("../../../../../examples/media/test.mid", (FMOD.MODE._2D | FMOD.MODE.HARDWARE | FMOD.MODE.CREATESTREAM), ref exinfo, ref sound);
ERRCHECK(result);[/code:188qaps3]

afik it’s a valid dls file. Does the DLS file have to be in a specific location and you only pass it the name and not path+name?
I also tried this by just using the name putting the dls in various directories but get the same error.

ty.

  • You must to post comments
0
0

Hey there,

I was just looking over your original post and I noticed something. You have:

[code:2v0muvox]
FMOD.CREATESOUNDEXINFO exinfo = new FMOD.CREATESOUNDEXINFO();
exinfo.dlsname = "../../../../../examples/media/sfx.dls";
exinfo.cbsize = Marshal.SizeOf(exinfo);
[/code:2v0muvox]

In particular, the cbsize call is interesting, because in other languages, like Objective C, it looks like this:

[code:2v0muvox]
FMOD_CREATESOUNDEXINFO exinfo;
memset( &exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO) );
exinfo.cbsize = sizeof( FMOD_CREATESOUNDEXINFO );
exinfo.dlsname = dlsname;
[/code:2v0muvox]

The big things I see of course are that the sizeof is set to the size of the structure type and not the instance of exinfo. The other thing I see is that the cbsize call comes before other calls.

Sorry to send you on a wild goose chase for gm16.dls. If I could remember where I got it… but at least you’ve got another DLS to work with, which honestly should work.

  • George
  • You must to post comments
0
0

There are no path restrictions on the DLS file, it is treated just like any file. You can in fact call create sound on that path and it will load it just like any other sound.

As for your MIDI, I can see you are not setting the cbsize parameter of the CREATESOUNDEXINFO struct. This may be the cause of your problems, it needs to be set to sizeof(FMOD_CREATESOUNDEXINFO).

  • You must to post comments
0
0

[quote="mathew":q83ka75n]
As for your MIDI, I can see you are not setting the cbsize parameter of the CREATESOUNDEXINFO struct. This may be the cause of your problems, it needs to be set to sizeof(FMOD_CREATESOUNDEXINFO).[/quote:q83ka75n]

I’m just going by what Mathew says here.
I pulled the "exinfo.cbsize = Marshal.SizeOf(exinfo); "

off another C# example on the forums.

  • You must to post comments
0
0

Thanks for the reply!

[quote="mathew":1bk5ntdf]There are no path restrictions on the DLS file, it is treated just like any file. You can in fact call create sound on that path and it will load it just like any other sound.

As for your MIDI, I can see you are not setting the cbsize parameter of the CREATESOUNDEXINFO struct. This may be the cause of your problems, it needs to be set to sizeof(FMOD_CREATESOUNDEXINFO).[/quote:1bk5ntdf]

EDIT:
OK, I found some C# examples that did it and modified to the following, but I still get the same error.

[code:1bk5ntdf] FMOD.CREATESOUNDEXINFO exinfo = new FMOD.CREATESOUNDEXINFO();
exinfo.dlsname = "../../../../../examples/media/sfx.dls";
exinfo.cbsize = Marshal.SizeOf(exinfo);

        result = system.createSound("../../../../../examples/media/test.mid", (FMOD.MODE._2D | FMOD.MODE.HARDWARE | FMOD.MODE.CREATESTREAM), ref exinfo, ref sound);
        ERRCHECK(result);[/code:1bk5ntdf]
  • You must to post comments
0
0

Could someone from FMOD please confirm with a working example in C# of what I need to do exactly to play a midi file with a user supplied dls file?

There is no example code and I’m just shooting in the dark here with no guidance as to whether it works or not and have limited time to expend on randomly testing things.

This is a standard use case imo and should be demonstrated in working examples that are consistent with documentation.

ty!

  • You must to post comments
0
0

As a quick test, perhaps you might look at removing all the flags and using:

[list:2mfo60kn]FMOD.MODE.SOFTWARE[/list:u:2mfo60kn]

  • George
  • You must to post comments
0
0

Sorry for the silence on this issue.

We have taken a look into the problem and found the cause of your issues. If you take a look at the import functions section of fmod.cs, and go down to CreateSound you can see some of them have CharSet.Unicode and some do not.

Since System.String is always unicode, we have updated fmod.cs so all of the createSound / createStream functions that take a string are set as unicode. Then in the wrapper createSound / createStream C# functions we OR in FMOD.MODE.UNICODE to the Mode flag.

These changes will be in our next release, if you aren’t interested in Unicode just remove the CharSet.Unicode from the import functions and it should work with your existing code above.

  • You must to post comments
0
0

I’m not sure how that works in C#, there is no info.

Could you explain it a little more?

  • You must to post comments
0
0

Thanks, I’m interested in Unicode so I’ll try what you suggest.

Thanks for the info.

Cheers,
sv/Tokyo

  • You must to post comments
0
0

Sorry, I was typing fast and should have probably been more explicit. Try:

result = system.createSound("../../../../../examples/media/test.mid", ( FMOD.MODE.SOFTWARE), ref exinfo, ref sound);

  • George
  • You must to post comments
0
0

ah, gotcha.

No…same result..bar err_file_bad.

I’m sure the dls is fine, generated it with AWAVE and it works ok.

  • You must to post comments
0
0

Would you mind posting the DLS and MID files so we can test as well?

  • George
  • You must to post comments
0
0

The midi is fine, any midi will do. This one works ok on default windows midi GM so it’s aok.

Unfortunately I can’t post the dls as it’s a test one I generated from a commercial sf2 via Awave. Looks ok to me.

Alternatively is there a publicly available GM compatible .dls anywhere we know works so we/I can test this with?

And thanks for persisting with this btw!

  • You must to post comments
0
0

Not a problem. It helps me keep sharp with FMOD too.

I’ve tested a file called: gm16.dls with FMOD. It’s out there on the web if you do a search with Google.

  • George
  • You must to post comments
0
0

ok, I gave up trying to find that file, after roundrobin on a bunch of websites all saying I had to be a member to download.

I found the gm.dls on winxp under system32/drivers, plugged that in and still get the same error.

So. it looks to me like I need to set something else here.
I would have thought a simple midi example would be included.

I actually need the ability to stream real time midi messages to the music system, but I may be able to get away with creating files and running them…if I can get it working.

How come midi support in FMOD is almost nonexistant? It’s not a dead protocol, and has a lot of advantages for certain games/apps.

  • You must to post comments
Showing 15 results
Your Answer

Please first to submit.