Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: How to load specific .midi (music) files from the cache?

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to load specific .midi (music) files from the cache?

    I'm making a Music System, this is what I have so far:

    if (c.absX >= 3205 && c.absX <= 3216 && c.absY >= 3209 && c.absY <= 3229) {
    c.outStream.createFrame(74);//Lumbridge
    c.outStream.writeWordBigEndian(76);//76 is the ID of the music.

    How can I make it so it loads specific .midi files from the cache:

    if (c.absX >= 3205 && c.absX <= 3216 && c.absY >= 3209 && c.absY <= 3229) {
    c.outStream.createFrame(74);//Lumbridge
    c.outStream.playMidi(./cache/midi/Harmony.midi)//This asks it to load and play the midi (Not really, it's just the example to help you understand).

    That's just an example, but I hope you understand what I am trying to say. I've tried everything. And I am in need of some help.

    How can I make it so it loads the .midi files from the cache and plays them.

    -Thanks.


  2. #2
    Junior Member
    Join Date
    Apr 2012
    Location
    Missouri, United States
    Posts
    17
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default Re: How to load specific .midi (music) files from the cache?

    What kind of object is the "c" variable?
    Why do you need the Music System to load the .midi files from the cache?
    Can you provide a SSCEE, if possible?

  3. #3
    Junior Member
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to load specific .midi (music) files from the cache?

    Quote Originally Posted by Gigggas View Post
    What kind of object is the "c" variable?
    Why do you need the Music System to load the .midi files from the cache?
    Can you provide a SSCEE, if possible?

    "c" is the client.

    I need it to load the .midi files and then play them in-game. (if you see the code, if you are in certain X and Y Coordinates, it plays the song).

  4. #4
    Junior Member
    Join Date
    Apr 2012
    Location
    Missouri, United States
    Posts
    17
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default Re: How to load specific .midi (music) files from the cache?

    Is your "client" class a custom class you created? Or is it from the Java Client library or another existing library?
    Would you be able to provide the java code for just your Music System class(es)?
    Last edited by Gigggas; April 9th, 2012 at 05:45 PM.

Similar Threads

  1. Script to clear Java plugin Cache..
    By Einstein in forum AWT / Java Swing
    Replies: 3
    Last Post: October 9th, 2011, 12:44 PM
  2. MIDI files?
    By Blackbird in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: July 3rd, 2011, 01:44 PM
  3. Cache Download problem
    By frozen java in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 27th, 2011, 08:04 PM
  4. Connecting to Cache through JDBC - error
    By javavick in forum JDBC & Databases
    Replies: 0
    Last Post: May 6th, 2010, 07:34 AM
  5. Music player problem
    By abhinavhardikar in forum What's Wrong With My Code?
    Replies: 6
    Last Post: February 9th, 2010, 08:41 PM