Search:

Type: Posts; User: DusteroftheCentury

Search: Search took 0.08 seconds.

  1. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Yes, Eclipse makes you do a special import thing rather than just drag and drop.

    I am so confused right now. The file acts like it is corrupted. However it is not because it will play in anything...
  2. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Thanks. Although I dont think the wav file im using is corrupted. It works in any music player, just not using java.

    Also, when I try to run the new jar file using the import method to import the...
  3. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Thank you so much guys! I tested it on a new .wav file and it does play in a loop! (It is a very short file and after playing more times than I can count, about 3 mins it stopped. Im guessing Java...
  4. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Im using Java SE 6 update 30, and I have no idea what you mean about different wave files.

    Thanks for helping.

    -Duster
  5. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Argh.

    It must be something wrong on my side. When i use the EXACT SAME CODE, it runs for about 30 secs then stops. What could be wrong with my computer? :confused:

    -Duster
  6. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    What is the correct code for the other method of making an ImageIcon? I tried

    URL pic = TestClass.class.getResource("PBn'J.gif");
    panel.add(new JLabel(pic));
    (It seemed to be the most obvious...
  7. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Wait...

    I tried to edit my your code to get what I want from mine (minus the button because it is not needed), and got the same issue... Ittl play for about 30 secs then stop. This didnt happen...
  8. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Ok first of all,
    Thank.You.So.Much.

    I tested your code and it does work. It plays the audio how I would want it. I cant see what the differences between it and my code that make it work or not...
  9. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Wait...

    Forget the resource thing for now, when I run it it plays for about 30 seconds- then stops and does not loop. The full file is 1:45 long.
    Does this have something to do with the AudioClip...
  10. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Thanks again for your continued help. So I found out that it does work outside of Eclipse but only with the resource files in the same folder. When I try to export the files into the jar, it can't...
  11. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    THANK YOU SO MUCH. YOU WERE SO HELPFUL! It works! It works! But only in Eclipse... What options do I check when exporting the jar to make sure it will work outside of Eclipse?
    The .wav and .gif...
  12. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    So drag the resources in next to the code? In the src folder?
    Or just in the project folder next to the src folder?
    Edit: I tried putting them in both places, didnt work :confused:
    Also tried...
  13. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Do I add the .wav into the jar?
    If so how? (If possible using Eclipse)

    Could you put the code for detecting if the url is valid? Or do I just check?
    Thx for helping.
    -Duster
  14. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Ok. I know how to do printlns but what do I add to them to make them debug? Also- When I run it outside of Eclipse, with it in the same folder as the music and pictures etc., it'll just give me what...
  15. Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Hey guys,

    I am new to Java and am working on a fun little program. It's kinda pointless, but its to teach me the concepts.
    Anyway, This is my code:



    import javax.swing.*;
    import...
Results 1 to 15 of 16