public class AudioFileLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private DebugWriter |
debugSound
The writer for logging sound related information or
null to not
log. |
Constructor and Description |
---|
AudioFileLoader(DebugWriter debugSound)
Private constructor to prevent instantiation.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
getInputStream(java.lang.String name,
java.lang.String action)
Returns an input stream for an audio file.
|
private java.io.InputStream |
getResource(java.lang.String name)
Returns an input stream for an audio file.
|
@Nullable private final DebugWriter debugSound
null
to not
log.public AudioFileLoader(@Nullable DebugWriter debugSound)
debugSound
- the writer for logging sound related information or
null
to not log@NotNull public java.io.InputStream getInputStream(@Nullable java.lang.String name, @NotNull java.lang.String action) throws java.io.IOException
action
identifies the
audio file. name
is an optional prefix.name
- the nameaction
- the action; may be null
java.io.IOException
- if the file cannot be located@NotNull private java.io.InputStream getResource(@NotNull java.lang.String name) throws java.io.IOException
name
- the resource namejava.io.IOException
- if the file cannot be located