Class AppletAudioClip

  • All Implemented Interfaces:
    java.applet.AudioClip

    public class AppletAudioClip
    extends java.lang.Object
    implements java.applet.AudioClip
    An applet audio clip using the javax.sound API.
    Version:
    $Revision: 1.8 $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.sound.sampled.Clip clip
      the clip
      private static Logger LOG  
    • Constructor Summary

      Constructors 
      Constructor Description
      AppletAudioClip​(java.net.URL location)
      Creates new AudioClip.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void dispose()
      Stops playing the clip and disposes it; the clip cannot be played after being disposed.
      void loop()
      Plays the clip in a continuous loop until the stop method is called.
      void play()
      Plays the clip from the beginning.
      void stop()
      Stops playing the clip.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final Logger LOG
      • clip

        private javax.sound.sampled.Clip clip
        the clip
    • Constructor Detail

      • AppletAudioClip

        public AppletAudioClip​(java.net.URL location)
        Creates new AudioClip. If the clip cannot be opened no exception is thrown, instead the methods of the AudioClip return without performing any operations.
        Parameters:
        location - the clip location
    • Method Detail

      • loop

        public void loop()
        Plays the clip in a continuous loop until the stop method is called.
        Specified by:
        loop in interface java.applet.AudioClip
      • play

        public void play()
        Plays the clip from the beginning.
        Specified by:
        play in interface java.applet.AudioClip
      • stop

        public void stop()
        Stops playing the clip.
        Specified by:
        stop in interface java.applet.AudioClip
      • dispose

        void dispose()
        Stops playing the clip and disposes it; the clip cannot be played after being disposed.