Results 1 to 5 of 5

Thread: Find out When a Midi Audio Player Has Finished Playing

  1. #1
    Join Date
    Nov 2009
    Posts
    140

    Find out When a Midi Audio Player Has Finished Playing

    Hello, I am learning java programming and while learning it, I am getting one problem. If I want to Determine When a Midi Audio Player Has Finished Playing then what type of program I have to used. I have check it on internet, but I have search this on internet, but I don't get any solution to solve this problem. So, please help me to get the solution.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: Find out When a Midi Audio Player Has Finished Playing

    Hello, for Finding When a Midi Audio Player Has Finished Playing you can simply make use of the code below:
    Code:
    sequencer.addMetaEventListener( new MetaEventListener() 
    {
     public void test(MetaMessage e) 
    {
     if (e.getType() == 47) 
    { 
    } 
    } 
    });

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Find out When a Midi Audio Player Has Finished Playing

    Hello, I think you need to use the books below for your purpose:
    • Concurrent Programming in Java: Design Principles and Pattern 2nd Edition
    • Designing Enterprise Applications with the J2EE Platform, Second Edition 2nd Edition
    • Designing Web Services with the J2EE 1.4 Platform: JAX-RPC, SOAP, and XML Technologies

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Find out When a Midi Audio Player Has Finished Playing

    I have got the code below which will solve your problem for checking the midi audio player has finished playing or not. So, just use it and solve your problem:
    Code:
    sequencer.addMetaEventListener( new MetaEventListener() 
    {
     public void check(MetaMessage metamessage)
     {
     if (metamessage.getType() == 47) 
    {               
     }
     }
    });

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Find out When a Midi Audio Player Has Finished Playing

    If you want to determine whether the midi audio player has finished playing or not:
    Code:
    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 sequence = MidiSystem.getSequencer();
        sequence.open();
        sequence.addMetaEventListener(new MetaEventListener()
     {
          public void meta(MetaMessage message) 
    {
            if (message.getType() == 47) 
    {
            }
          }
        });
    
      }
    }

Similar Threads

  1. Replies: 4
    Last Post: 27-05-2013, 10:55 AM
  2. Media Player 11 for Vista stutters playing audio
    By KRI!PAL in forum Vista Help
    Replies: 8
    Last Post: 04-10-2011, 03:21 PM
  3. Where to find free Songbird Audio Player for MP3, FLAC, OGG
    By KornFlexia in forum Windows Software
    Replies: 6
    Last Post: 16-11-2010, 10:45 PM
  4. Behringer BCA2000 USB Audio/MIDI failure
    By Christina 80 in forum Hardware Peripherals
    Replies: 4
    Last Post: 03-10-2010, 04:59 AM
  5. Replies: 3
    Last Post: 20-12-2008, 04:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,204,674.86546 seconds with 17 queries