public class ClipCache
extends java.lang.Object
| Constructor and Description |
|---|
ClipCache(@NotNull AudioFileLoader audioFileLoader,
@Nullable DebugWriter debugSound)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
@Nullable javax.sound.sampled.DataLine |
allocateClip(@Nullable java.lang.String name,
@NotNull java.lang.String action)
Allocates a new clip.
|
void |
freeClip(@NotNull javax.sound.sampled.Line clip)
Deallocates a clip.
|
public ClipCache(@NotNull
@NotNull AudioFileLoader audioFileLoader,
@Nullable
@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 freeClip(@NotNull
@NotNull javax.sound.sampled.Line clip)
clip - the clip to deallocate@Nullable
public @Nullable javax.sound.sampled.DataLine allocateClip(@Nullable
@Nullable java.lang.String name,
@NotNull
@NotNull java.lang.String action)
name - an optional prefix for the action nameaction - the action name of the clip to allocatenull if an error occurs