Search:

Type: Posts; User: pbrockway2

Search: Search took 0.08 seconds.

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

    You're welcome.

    As you can see from the image I'm using Eclipse and I just drag and drop files into the package view wherever I want them.

    You're probably right: get some more straight forward...
  2. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    I can confirm that that wav file (with the code in #20) runs fine: ie loops when it gets to the end. This is also true when I export the project as an executable jar and run that.

    I don't really...
  3. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Audacity: Free Audio Editor and Recorder is good and popular almost to the point of being "standard". I used it to construct the wav file I used to test your code.

    The location of the two...
  4. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    All I meant is that *my* wav file loops fine. So maybe something is wrong with the one you are using. I know you said you had played it in another application, but it is still worth replacing it...
  5. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    We are also using different wav files. Try changing the file you are using. Mine is a wav signed 16bit PCM (whatever that means...)

    Also if you are using an older version of Java try compiling...
  6. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    This is your code slightly changed (imports and location of the gif). The API documentation is the place to look to see what alternatives are available.



    import java.applet.Applet;
    import...
  7. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    I renamed my wav file, created a gif file and ran exactly the code you posted. It ran fine ie 3 min wav file looped.

    But I have a few questions:

    Imports are a compiler time thing and don't...
  8. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Just out of interest I made a .wav file and adapted the following from your code:



    import java.net.URL;
    import javax.swing.JFrame;

    public class LoopFrame extends JFrame {
    AudioClip...
  9. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    According to the API docs you've got play(), loop() and stop().

    In your original post you call loop() which should ... loop. The fact that it stops after c30s is weird. My guess is that whatever...
  10. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Maybe I'm wrong - in which case someone should chime in - but I don't think exporting as a *runnable* jar has any options. Exporting as a jar does, and you can select the resources you want to...
  11. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Yes, the wav file goes right next to TestClass in the Eclipse's Package view.

    "didnt work" == what? Did you print the url? What did it say? Did you check on your hard disk at that location for...
  12. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    In Eclipse the "File->Export->Runnable Jar" wizard should do this provided you have the wav file in the same place as the class. I think if you copy the wav file into the package tree next to the...
  13. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    A good place to start would be printing the url you are using for the sound clip. In the case of Eclipse it will be a file: url. Then you go looking on your hard disk to see if the file is at that...
  14. Re: Need help playing sound in backround of a program in a loop.(Please Fix my code!)

    Make sure that the wav file is in the jar archive and in the right place, ie next to TestClass.class. Also that the spelling of the jar entry is "PBnJ.wav". In particular Windows isn't fussy about...
Results 1 to 14 of 14