Results 1 to 4 of 4

Thread: Java MIDI support?????

  1. #1

    Thread Starter
    Lively Member Bootking's Avatar
    Join Date
    Mar 2003
    Location
    Marquette University
    Posts
    90

    Question Java MIDI support?????

    Hey Everybody!

    Anybody know how to play a MIDI file in Java or in Java applets?
    I know it's possible but I just don't know how to do it.
    Check out my band's website!
    Walter Walker Band

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    javax.sound.midi
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Quite Easy. The java.applet.AppletStub and java.applet.AppletContext interfaces describe services that the web browser or applet viewer provides to applets. Note if your applet declares a main method these interfaces will have null AppletStub and AppletContext members. Therefore if you try to use these methods in such an applet a NullPointerException will be thrown.

    The applet class has five methods that download sounds from the web. The two play() methods download a sound file and play it immediately. The two getAudioClip() methods and the static Applet.newAudioClip() method save a sound for later playing.

    public void play(Url u)
    public void play(Url u, String filename)
    public AudioClip getAudioClip(Url u)
    public AudioClip getAudioClip(Url u, String filename)
    public static final AudioClip newAudioClip(Url u)

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    But in non-Applets you still have to use the javax.sound.midi package...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width