src<<sound('Song name.mid',1)
The song is about 3 minutes and I have it set to repeat. I don't know why the CPU raises so high. Does it download the song as it plays? If so, is there a way to fully load it then for it to begin playing without causing massive lag to the game? Same goes for any sounds(.wav files only lag the game for like a second but still need a more efficient way).
This is all tested in a single player world. Oh and also, 1 more question. Is there a way to play an MP3 upon game start up without having to open it from somewhere on your P.C.?
I really want to have a lot of nice sounds in the game to give players a greater experience but if it comes with the price of lag, what's the point?
Thanks in advance to anyone with tips or an efficient code to solve the problem :).
Perhaps something is wrong with your sound settings. For example, I can turn my hardware acceleration for sound down and get it to the point where all sounds played use software emulation. This would cause a CPU spike. Maybe a similar change exists on your system.
But for everybody else, it works properly. I don't get CPU spikes when playing MIDI files.
All I can say is that you could try to set the sound datum's status variable to SOUND_STREAM. This disables several features at the cost of better performance.