Jump to content
  • Advertisement
Sign in to follow this  
RuneLancer

MCI question

This topic is 4088 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!