Results 1 to 7 of 7

Thread: continuos audio

  1. #1
    beijct is offline Member
    Join Date
    Nov 2011
    Posts
    12
    Rep Power
    0

    Default continuos audio

    I'm trying to get a short wav file to loop continuously in an applet, but I'm having some trouble.
    I wrote a for loop to do it but it doesn't work (the clip just plays once)
    Heres my code:

    Java Code:
    for(int i=0; i<1000; i++)
    		{
    			wav.play();
    		}
    If anyone could tell me how I could get this audio into a continuos loop it would be much appreciated, thanks.

  2. #2
    shall is offline Senior Member
    Join Date
    Apr 2012
    Posts
    199
    Rep Power
    0

    Default Re: continuos audio


  3. #3
    jsobel is offline Member
    Join Date
    Apr 2012
    Posts
    68
    Rep Power
    0

    Default Re: continuos audio

    AudioClip clip = Applet.newAudioClip(url);
    clip.loop();

  4. #4
    Stoyicker is offline Member
    Join Date
    Jan 2012
    Posts
    32
    Rep Power
    0

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: continuos audio

    Quote Originally Posted by Stoyicker View Post
    Dude, use this:
    Whatever for? jsobel has already supplied the two-line solution. You can't get much easier than that.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    Stoyicker is offline Member
    Join Date
    Jan 2012
    Posts
    32
    Rep Power
    0

    Default Re: continuos audio

    Come on, just wanted to help, I don't think an extra reply may hurt anyone.

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: continuos audio

    Suggesting the use of a third party class for something that's so easy to do with the standard JDK isn't helpful. It can be confusing.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. how to stop audio(mp3)
    By shruts in forum New To Java
    Replies: 7
    Last Post: 08-07-2011, 04:19 PM
  2. Audio files.
    By sarah jain in forum Networking
    Replies: 1
    Last Post: 03-11-2011, 05:36 PM
  3. Audio conferencing using JMF
    By sathishkumar in forum Advanced Java
    Replies: 0
    Last Post: 03-10-2011, 03:02 PM
  4. playing audio in J-App??
    By ashton in forum New To Java
    Replies: 3
    Last Post: 01-30-2009, 08:50 AM
  5. Audio Recorder
    By elizabeth in forum Java Applets
    Replies: 1
    Last Post: 08-06-2007, 09:21 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
  •