Sequencer: addMetaEventListener(MetaEventListener listener) : Sequencer « javax.sound.midi « Java by API






Sequencer: addMetaEventListener(MetaEventListener listener)

  

import javax.sound.midi.MetaEventListener;
import javax.sound.midi.MetaMessage;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Sequencer;

public class Main {
  public static void main(String[] argv) throws Exception {
    Sequencer sequencer = MidiSystem.getSequencer();
    sequencer.open();
    sequencer.addMetaEventListener(new MetaEventListener() {
      public void meta(MetaMessage event) {
        if (event.getType() == 47) {
          // Sequencer is done playing
        }
      }
    });

  }
}

   
    
  








Related examples in the same category

1.Sequencer.getMicrosecondPosition()
2.Sequencer: setSequence(Sequence sequence)
3.Sequencer: start()