How do I determine when a Midi Audio Player has finished playing?

John Zukowski

Add a MetaEventListener to the sequencer. See How do I load and play a Midi audio file? for how to setup the sequencer.

MetaEventListener listener = new MetaEventListener() {
  public void meta(MetaMessage event) {
    if (event.getType() == 47) {
      System.out.println("Done playing");
    }
  }
};
sequencer.addMetaEventListener(listener);
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact