Game Music Slowdown
Hi, I'm making a 2D platformer and I added a thread (with the lowest priority) that will play midi files. The game now runs noticeably slower (it used to use roughly 2 -10% of my 1.73 gHz CPU, now with midi music it now uses about 40-75%)
I've also tried this with .ogg and .mp3 files and they all have the same problem
Here is the thread class I'm using:
publicclass MusicThreadextends Thread
{
public MusicThread(String filename)
{
super(filename);
}
publicvoid run()
{
try
{
Sequencer seqr = MidiSystem.getSequencer();
Sequence seq = MidiSystem.getSequence(new File(this.getName()));
seqr.open();
seqr.setSequence(seq);
seqr.start();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}
does anyone know how I can improve the performance?

