Applet package Causes audio clip to replay continually by using public void loop() method - Applets

Q.  An applet can play an audio file represented by the AudioClip interface in the java, applet package Causes the audio clip to replay continually in which method?

- Published on 19 Oct 15

a. public void play()
b. public void loop()
c. public void stop()
d. None of the above

ANSWER: public void loop()
 

    Discussion

  • Nirja Shah   -Posted on 15 Dec 15
    - An audio file can be played in an applet which is represented by the AudioClip interface in the java.applet package. The AudioClip interface has three methods, which are as follows:
    public void play(): Plays the audio clip one time, from the beginning.

    public void loop(): Causes the audio clip to replay continually.

    public void stop(): Stops playing the audio clip.

    - The AudioClip object can be obtained by invoking the getAudioClip() method of the Applet class.
    - This method immediately returns whether or not the URL resolves to an actual audio file.
    - Unless an attempt is made to play the audio clip the audio file is not downloaded.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)