4 Replies Latest reply: Oct 25, 2010 9:59 AM by captfoss RSS

    Java's sound package dosn't support type 1 midi's?

    805433
      I have around 1000 midi files i have implemented into my application (it's a game, so most are sounds others are music).

      So im using the simple sequencer code;
      Sequence sequence = MidiSystem.getSequence(new ByteArrayInputStream(buffer));
                               Sequencer sequencer = MidiSystem.getSequencer();
                               sequencer.open();
                                  sequencer.setSequence(sequence);
                               sequencer.start()
      However, on type 1 midi's it always throws exceptions; these are;

      "Invalid midi file" and "EOFMidifile" before they play, however, after debugging it appears that these are all type 1 midi's.

      Does anyone know a way around this?

      The files are not corrupt, as they can play in media players fine and they are midi format because i've already debugged them.

      Thanks for any reponses.