Sign in to follow this  
RuneLancer

MCI question

Recommended Posts

I'm writing a full game tutorial for a message board I occasionally go to. The project is fairly simple and uses basic stuff to render its media (namely the GDI and MCI.) I have an unusual issue with MCI though. Whenever I load a midi file, it takes a good 5-6 seconds. However, when loading a sound, it's nearly instantaneous. Once the midis are loaded, I can play them pretty much instantly, though. What gives? Is there any way around this? The only part of the game that takes any time to load at all is the music, and it's long enough to be annoying considering the game's a fairly small one. I only have about 5-6 midis, none of them any larger than 50k. For reference's sake, I load them using mciSendString with "open (file goes here) alias (alias name goes here)". The return value indicates everything went through without a hitch. Maybe there's a better way of doing this? I dunno. I'm rather disappointed by this (relatively) huge delay. If there's a better way of playing midis that doesn't involve any third party libraries (including DirectX; I'd like to stay away from it for the scope of this tutorial) I'm not opposed to changing some code around a bit.

Share this post


Link to post
Share on other sites
I seem to have found the problem.

http://www.virtualdub.org/blog/pivot/entry.php?id=77

This is not a very portable solution though. I can easily do this, but the people whom I'm writing the tutorial for probably can't, nor would I advise it anyway given the risks of modifying system DLLs.

Therefore I'm going to look into loading midis some other way, or I'll just plain stick with the delay. Hopefully this will enlighten some poor soul also wondering what the delay is like.

Share this post


Link to post
Share on other sites
There's got to be some solution in DirectSound/DirectShow, I'm thinking. MCI is ancient... and I'm surprised Microsoft is still putting it in their SDK.

MCI is also very simple... and doesn't give the user much control... other than start and stop.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this