Class ClipManager


  • public class ClipManager
    extends java.lang.Object
    Manages a set of sound clips (short sound effects). Multiple sound effects can be played simultaneously.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void play​(@Nullable java.lang.String name, @NotNull java.lang.String action)
      Plays the given sound effect.
      void shutdown()
      Terminates all running clips and free resources.
      • Methods inherited from class java.lang.Object

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

      • ClipManager

        public ClipManager​(@NotNull
                           @NotNull AudioFileLoader audioFileLoader,
                           @Nullable
                           @Nullable DebugWriter debugSound,
                           @NotNull
                           @NotNull SoundTaskExecutor soundTaskExecutor)
        Creates a new instance.
        Parameters:
        audioFileLoader - the audio file loader for loading audio files
        debugSound - the writer for logging sound related information or null to not log
        soundTaskExecutor - the global sound task executor
    • Method Detail

      • play

        public void play​(@Nullable
                         @Nullable java.lang.String name,
                         @NotNull
                         @NotNull java.lang.String action)
        Plays the given sound effect. This function returns immediately.
        Parameters:
        name - an optional prefix for the action name
        action - the action name of the sound effect
      • shutdown

        public void shutdown()
                      throws java.lang.InterruptedException
        Terminates all running clips and free resources.
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted while waiting for the shutdown