Domanda

I'm playing a MIDI file, and I have a timer which periodically checks the status of the alias. When it is stopped, this executes:

mciSendString(L"seek Music to start", NULL, 0, NULL);
mciSendString(L"play Music", NULL, 0, NULL);

I'm using this as a part of a basic game I'm creating. I've noticed that whenever the song repeats, there's a split second where the application freezes. I thought this was caused by me loading the file each time, but if I already have it loaded and am just seeking within it, it shouldn't slow down, should it? How can I keep it from delaying?

I know MCI probably isn't the best option for playing midi files. However, all my program needs is to load two midi files into memory and play them on a loop. Originally I looked into third-party libraries, but most of these seem like WAY more than I need, and a lot of them are much too prohibitively complicated. However, if there was a really basic, simple one out there which would accomplish what I need, I would love to hear about it. I'm not looking for multilayer 3d sound or anything - just the ability to load to memory, play and repeat.

È stato utile?

Soluzione

I was talking to a friend, and he recommended that I use a thread. "Well, duh", I thought. "How could I possibly have not thought of that?"

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top