Thread: RainyMood Add-on for RSPS Client

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 RainyMood Add-on for RSPS Client 
    Google it ffs

    Reich's Avatar
    Join Date
    Mar 2011
    Age
    30
    Posts
    825
    Thanks given
    120
    Thanks received
    174
    Rep Power
    105
    So my first question was "Why not just go to rainymood.com? It doesent stop after 30 minutes."
    My answer is simply this: It didn't take very long at all. For the people who may actually like Rainy Mood this could be pretty cool.

    Features v0.1:
    -Starts out with a 30 seocnd clip of thunder
    -Plays for 30 minutes exactly
    -Helps relax you in times of need

    This is will eventually be worked on and added to make better.
    Plans for v0.2:
    -Rain NEVER stops
    -Toggles for rain/thunder
    -Possibly some type of Gui Player


    Start off by downloading the MP3 files and placing the 2 .mp3 files in your caches root directory
    MP3 Download:
    http://dl.dropbox.com/u/45027916/Rainy%20Mood.zip

    Now in your client files create a new .java file and name it
    RainyMood.java
    Code:
    import java.io.BufferedInputStream;
    import java.io.FileInputStream;
    import javazoom.jl.player.Player;
    import sign.signlink;
    
    public class RainyMood{
        private String filename;
        private Player player; 
        private static String RainyMood = signlink.findcachedir() + "RainyMood.mp3";
        private static String RainyMoodThunder = signlink.findcachedir() + "RainyMoodThunder.mp3";
        public RainyMood(String filename) {
            this.filename = filename;
        }
    
        public void close() { if (player != null) {
                player.close();
            } }
    
        public void play() {
            try {
                FileInputStream fis = new FileInputStream(filename);
                BufferedInputStream bis = new BufferedInputStream(fis);
                player = new Player(bis);
            }
            catch (Exception e) {
                System.out.println("Problem playing file " + filename);
                System.out.println(e);
            }
    
            new Thread() {
                @Override
                public void run() {
                    try { player.play(); }
                    catch (Exception e) { System.out.println(e); }
                }
            }.start();
        }
    
        public static void main(String[] args) {
            playRain();
            playThunder();
        }
        
        public static void playRain() {
            String RainyMoodMP3Dir = RainyMood;
            RainyMood RainyMoodMP3 = new RainyMood(RainyMoodMP3Dir);
            RainyMoodMP3.play();
        }
        
        public static void playThunder() {
            String RainyMoodThunderMP3Dir = RainyMoodThunder;
            RainyMood RainyMoodThunderMP3 = new RainyMood(RainyMoodThunderMP3Dir);
            RainyMoodThunderMP3.play();
        }
    }

    Save and close

    Open client.java

    Search:
    Code:
    public static void main
    The line after
    Code:
    try {
    add
    Code:
    RainyMood.main(args);
    Save and close.

    Make sure you have the Player library in you're client or it wont compile
    Use Google to figure out how to import librarys if youre not using and IDE
    Download Player.jar:
    http://dl.dropbox.com/u/45027916/Player.jar

    Please don't flame
    Programmers are machines that convert caffeine into code
    Reply With Quote  
     

  2. #2  
    ಠ_ಠ

    Joshua's Avatar
    Join Date
    May 2010
    Posts
    1,903
    Thanks given
    397
    Thanks received
    708
    Rep Power
    803
    So you're adding rain sounds to your client? Kinda strange as there is no rain in the clients of this section.

    If perhaps you made a full weather system, that would be quite interesting.
    Reply With Quote  
     

  3. #3  
    i want a PM. The best in life is free.
    Project M's Avatar
    Join Date
    Mar 2012
    Posts
    368
    Thanks given
    20
    Thanks received
    13
    Rep Power
    14
    Code:
    .\RainyMood.java:3: error: package javazoom.jl.player does not exist
    import javazoom.jl.player.Player;
                             ^
    .\RainyMood.java:16: error: cannot find symbol
                player.close();
                      ^
      symbol:   method close()
      location: variable player of type Player
    .\RainyMood.java:23: error: constructor Player in class Player cannot be applied
     to given types;
                player = new Player(bis);
                         ^
      required: no arguments
      found: BufferedInputStream
      reason: actual and formal argument lists differ in length
    .\RainyMood.java:33: error: cannot find symbol
                    try { player.play(); }
                                ^
      symbol:   method play()
      location: variable player of type Player
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    4 errors
    Trykk en tast for å fortsette...
    hmm, i did place player.jar in the i should.
    Reply With Quote  
     

  4. #4  
    Super Donator


    Join Date
    Jun 2007
    Age
    31
    Posts
    2,157
    Thanks given
    316
    Thanks received
    282
    Rep Power
    779
    Quote Originally Posted by Initium View Post
    Code:
    .\RainyMood.java:3: error: package javazoom.jl.player does not exist
    import javazoom.jl.player.Player;
                             ^
    .\RainyMood.java:16: error: cannot find symbol
                player.close();
                      ^
      symbol:   method close()
      location: variable player of type Player
    .\RainyMood.java:23: error: constructor Player in class Player cannot be applied
     to given types;
                player = new Player(bis);
                         ^
      required: no arguments
      found: BufferedInputStream
      reason: actual and formal argument lists differ in length
    .\RainyMood.java:33: error: cannot find symbol
                    try { player.play(); }
                                ^
      symbol:   method play()
      location: variable player of type Player
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    4 errors
    Trykk en tast for å fortsette...
    hmm, i did place player.jar in the i should.
    Also have to include it in your classpath when building and running
    Reply With Quote  
     

  5. #5  
    Google it ffs

    Reich's Avatar
    Join Date
    Mar 2011
    Age
    30
    Posts
    825
    Thanks given
    120
    Thanks received
    174
    Rep Power
    105
    Quote Originally Posted by Joshua View Post
    So you're adding rain sounds to your client? Kinda strange as there is no rain in the clients of this section.

    If perhaps you made a full weather system, that would be quite interesting.
    Yes this has kind of sparked the idea already. I doubt itll be worked on anytime soon atleast by myself.

    And for the people with the errors.

    javac -cp ./Player.jar *.java sign/*.java
    Programmers are machines that convert caffeine into code
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Apr 2012
    Posts
    479
    Thanks given
    36
    Thanks received
    72
    Rep Power
    0
    oh wow you're so dumb, here's an easier way
    no need for cache edits or anything, and more importantly, it's just 1 line of code

    Code:
    openURL("http://rainymood.com/");
    Reply With Quote  
     

  7. #7  
    Super Donator


    Join Date
    Jun 2007
    Age
    31
    Posts
    2,157
    Thanks given
    316
    Thanks received
    282
    Rep Power
    779
    Quote Originally Posted by imbackagain View Post
    oh wow you're so dumb, here's an easier way
    no need for cache edits or anything, and more importantly, it's just 1 line of code

    Code:
    openURL("http://rainymood.com/");
    What if I don't want my browser open while playing? What if my security manager is so strict I don't allow access to outside URLs? What if I don't have JavaScript or Flash enabled?
    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Banned
    Join Date
    Apr 2012
    Posts
    479
    Thanks given
    36
    Thanks received
    72
    Rep Power
    0
    Quote Originally Posted by Sydney's Bitch View Post
    What if I don't want my browser open while playing? What if my security manager is so strict I don't allow access to outside URLs? What if I don't have JavaScript or Flash enabled?
    what if you don't want a 1GB cache
    what if you don't even care about listening the rain
    Reply With Quote  
     

  10. #9  
    Banned

    Join Date
    May 2011
    Posts
    1,238
    Thanks given
    193
    Thanks received
    267
    Rep Power
    0
    Quote Originally Posted by imbackagain View Post
    what if you don't want a 1GB cache
    what if you don't even care about listening the rain
    Well, considering the download is 30MB, unless your cache is 970MB then it won't be 1 GB with this added. So get off your high horse.

    OT: A different concept, but can be relaxing.
    Reply With Quote  
     

  11. #10  
    Client Developer

    Pb600's Avatar
    Join Date
    Dec 2008
    Posts
    2,153
    Thanks given
    259
    Thanks received
    472
    Rep Power
    925
    I was looking at the site, that's music URL http://174.36.223.28/audio1295/SeparatedPart2.mp3
    They Randomize the IP between 173.193.205.68 and 174.36.223.28.
    With JMF you could use the link to play as stream and write on disk while streaming, so next time that you reproduce it will stream from file till where file data is available.

    Loop the music is the easier thing ever, I also think that you don't even have to reproduce the whole music before start again, that way you would save some memory space.
    That's a better way to do this, because I really think that no one would like to download 30MB of one music to listen to rain, even because it's 1/3 of some worst cache size.

    Using your library:
    Code:
    	public static void main(String[] args) throws IOException, JavaLayerException {
    		String link = "http://174.36.223.28/audio1295/SeparatedPart2.mp3";
    		URLConnection con = new URL(link).openConnection();
    		InputStream in = con.getInputStream();
    		Player player = new Player(in);
    		player.play();
    	}
    Hint:
    Code:
    	player.setPlayBackListener(new PlaybackListener() {
    			@Override
    			public void playbackFinished(PlaybackEvent evt) {
    				/** Do Something here to start again **/
    			}
    		});
    btw this Player class is really poor even the AdvancedPlayer is garbage.
    Attached image
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. HELP { how do i add more letters to my rsps?
    By Obito Uchiha in forum Help
    Replies: 2
    Last Post: 12-21-2011, 07:43 AM
  2. how do i add more letters for my rsps?
    By Obito Uchiha in forum Help
    Replies: 3
    Last Post: 12-20-2011, 06:25 PM
  3. Replies: 0
    Last Post: 10-10-2011, 12:54 AM
  4. How to add Custom Items to a 562 RSPS?
    By Exorcist in forum Help
    Replies: 1
    Last Post: 07-19-2011, 09:15 AM
  5. Basic Tutorial: How to add npc's to your RSPS!
    By H A W X in forum Tutorials
    Replies: 16
    Last Post: 02-28-2011, 04:20 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •