An MCI error occures when you tell the the MCI object to play a tune. The error is that the MCI("status tune mode") commmand returns "playing" as a string even though the music is not playing. Eventually the music will start to play despite this error, but for a duration of 1 or 2 seconds the MCI string will read "playing" when there is nothing being played. MCI("play tune"), MCI("play tune from 0") and MCI("resume") all exhibited the same occasional error. This error causes my game to be unplayable.
In my game there are active objects which fall down the screen, and you must press a particular key when the object has fallen. These active objects fall in time to the music being played by the MCI object. I used MCI because unlike the "play music" action, I can load external audio files. Meaning I can create new levels without editing the .exe by storing the positions of active objects in an ini file.
The basic code works something like this:
#DEFINE PLAYBAR = 8000
int stopnotes = 0
start of frame : centre display at (100,8000)
while (stopnotes == 0) : y("note")++;
always : y("initiate_music_note")++;
if y("note") > PLAYBAR : destory "note"
start of frame : MCI("open "+Appdrive$+Appdir$+"song.mp3 alias tune")
when y("initiate_music_note") > PLAYBAR : MCI("play tune"), destroy("initiate_music_note") , set stopnotes = 1
while (stopnotes == 1) : MCI("status tune mode")
while (stopnotes == 1) : set alterable string of syncstring to MCI(return string)
compair 2 general values , alterable string("syncstring") equals "playing" : set stopnotes = 0
This segment of code will move any number of active object "note" down the screen towards towards an invisible bar. When the note reaches the bar, the note is desroyed. If the note has a disapearing animation of a blue light flashing, you will see flashes in time to the music (provided the notes on the play area are positioned correctly).
Is there an MCI command I am unaware of that flushes the MCI memory? Perhaps there is a set of MCI commands I could use in a specific order to eliminate the error? I've searched the forum for information and found none, and dissected the offical example with no results.
I'm unaware of how the MCI object operates at it's core level. Whether it is part of TGF or if it is a function call to windows is beyond me. However I would like to know this information. I'd like to know if it can or cannot be fixed. What sort of details are there about MCI? All I know is it opens a handful of audio file types and plays them with a bit of control.