public class ClipManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private ClipCache |
clipCache
The clip cache used to allocate new clips.
|
private java.util.concurrent.ExecutorService |
executorService
The executor service used to play sound clips.
|
Constructor and Description |
---|
ClipManager(AudioFileLoader audioFileLoader,
DebugWriter debugSound)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
play(java.lang.String name,
java.lang.String action)
Plays the given sound effect.
|
void |
shutdown()
Terminates all running clips and free resources.
|
@NotNull private final ClipCache clipCache
@NotNull private final java.util.concurrent.ExecutorService executorService
public ClipManager(@NotNull AudioFileLoader audioFileLoader, @Nullable DebugWriter debugSound)
audioFileLoader
- the audio file loader for loading audio filesdebugSound
- the writer for logging sound related information or
null
to not logpublic void play(@Nullable java.lang.String name, @NotNull java.lang.String action)
name
- an optional prefix for the action nameaction
- the action name of the sound effectpublic void shutdown()