public class SoundSystemConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ATTENUATION_LINEAR
Global identifier for linear attenuation.
|
static int |
ATTENUATION_NONE
Global identifier for no attenuation.
|
static int |
ATTENUATION_ROLLOFF
Global identifier for rolloff attenuation.
|
static String |
EXTENSION_MIDI
A Regular expression for determining if a file's extension is MIDI.
|
static String |
PREFIX_URL
A Regular expression for determining if a path is an online URL.
|
static Object |
THREAD_SYNC
Lock object used to synchronize the three threads used by SoundSystem.
|
static int |
TYPE_NORMAL
A normal (non-streaming) source.
|
static int |
TYPE_STREAMING
A streaming source.
|
| Constructor and Description |
|---|
SoundSystemConfig() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addLibrary(Class libraryClass)
Adds an entry to the list of library types.
|
static void |
addStreamListener(IStreamListener streamListener)
Adds an entry to the list of stream listeners.
|
static ICodec |
getCodec(String filename)
Returns the codec that can be used to read audio data from the specified
file.
|
static int |
getDefaultAttenuation()
Returns the default attenuation model used when one is not specified.
|
static float |
getDefaultFadeDistance()
Returns the default fade distance used when one is not specified.
|
static float |
getDefaultRolloff()
Returns the default rolloff factor used when one is not specified.
|
static float |
getDopplerFactor()
Returns the doppler factor, for determining Doppler Effect scale.
|
static float |
getDopplerVelocity()
Returns the Doppler Velocity, for use in Doppler Effect.
|
static int |
getFileChunkSize()
Returns the size of each chunk to read at a time for loading (non-streaming)
files.
|
static LinkedList<Class> |
getLibraries()
Returns the list of library types.
|
static String |
getLibraryDescription(Class libraryClass)
Return the longer description of the specified library, or null if error.
|
static String |
getLibraryTitle(Class libraryClass)
Return the short title of the specified library, or null if error.
|
static SoundSystemLogger |
getLogger()
Returns a handle to the message logger.
|
static float |
getMasterGain()
Returns the value for the overall volume.
|
static int |
getMaxFileSize()
Returns the maximum number of bytes to read in for (non-streaming) files.
|
static int |
getNumberNormalChannels()
Returns the maximum number of normal (non-streaming) channels that can be
created.
|
static int |
getNumberStreamingBuffers()
Returns the number of buffers used for each streaming sorce.
|
static int |
getNumberStreamingChannels()
Returns the maximum number of streaming channels that can be created.
|
static String |
getOverrideMIDISynthesizer()
Returns the name of the MIDI synthesizer to use instead of the default, or
empty string if none was specified.
|
static String |
getSoundFilesPackage()
Returns the package where sound files are located.
|
static int |
getStreamingBufferSize()
Returns the number of bytes to load at a time when streaming.
|
static boolean |
libraryCompatible(Class libraryClass)
Checks if the specified library class is compatible on the user's machine.
|
static boolean |
midiCodec()
Indicates whether or not there is a codec for reading from MIDI files.
|
static void |
notifyEOS(String sourcename,
int queueSize)
Notifies all stream listeners that an End Of Stream was reached.
|
static void |
removeLibrary(Class libraryClass)
Removes the specified library from the list of library types.
|
static void |
removeStreamListener(IStreamListener streamListener)
Removes an entry from the list of stream listeners.
|
static boolean |
reverseByteOrder(Class libraryClass)
Return whether or not requires reversal of audio data byte-order.
|
static void |
setCodec(String extension,
Class iCodecClass)
Uses the specified file extension to associate a particular file format
with the codec used to read audio data from it.
|
static void |
setDefaultAttenuation(int model)
Sets the default attenuation model to use when one is not specified.
|
static void |
setDefaultFadeDistance(float distance)
Sets the default fade distance to use when one is not specified.
|
static void |
setDefaultRolloff(float rolloff)
Sets the default rolloff factor to use when one is not specified.
|
static void |
setDopplerFactor(float factor)
Sets the doppler factor, for determining Doppler Effect scale.
|
static void |
setDopplerVelocity(float velocity)
Sets the Doppler velocity, for use in Doppler Effect.
|
static void |
setFileChunkSize(int size)
Sets the size of each chunk to read at a time for loading (non-streaming)
files.
|
static void |
setLogger(SoundSystemLogger l)
Changes the message logger to use for handling status messages, warnings,
and error messages.
|
static void |
setMasterGain(float value)
Sets the varriable used for overall volume, affecting all sources.
|
static void |
setMaxFileSize(int size)
Sets the maximum number of bytes to read in for (non-streaming) files.
|
static void |
setNumberNormalChannels(int number)
Sets the maximum number of normal (non-streaming) channels that can be
created.
|
static void |
setNumberStreamingBuffers(int num)
Sets the number of buffers used for each streaming sorce.
|
static void |
setNumberStreamingChannels(int number)
Sets the maximum number of streaming channels that can be created.
|
static void |
setOverrideMIDISynthesizer(String name)
Sets the name of the MIDI synthesizer to use instead of the default.
|
static void |
setSoundFilesPackage(String location)
Sets the package where sound files are located.
|
static void |
setStreamingBufferSize(int size)
Sets the number of bytes to load at a time when streaming.
|
public static final Object THREAD_SYNC
public static final int TYPE_NORMAL
public static final int TYPE_STREAMING
public static final int ATTENUATION_NONE
public static final int ATTENUATION_ROLLOFF
public static final int ATTENUATION_LINEAR
public static String EXTENSION_MIDI
public static String PREFIX_URL
public static void addLibrary(Class libraryClass) throws SoundSystemException
libraryClass - Derivitive of class 'Library'.SoundSystemExceptionpublic static void removeLibrary(Class libraryClass) throws SoundSystemException
libraryClass - Derivitive of class 'Library'.SoundSystemExceptionpublic static LinkedList<Class> getLibraries()
public static boolean libraryCompatible(Class libraryClass)
libraryClass - Library type to check.public static String getLibraryTitle(Class libraryClass)
libraryClass - Derivitive of class 'Library'.public static String getLibraryDescription(Class libraryClass)
libraryClass - Derivitive of class 'Library'.public static boolean reverseByteOrder(Class libraryClass)
libraryClass - Derivitive of class 'Library'.public static void setLogger(SoundSystemLogger l)
SoundSystemLogger class should be
extended and methods overriden to change how messages are handled. Then,
the overridden class should be instantiated, and a call made to
SoundSystemConfig.setLogger() before creating the SoundSystem object.
If an alternate logger is not set by the user before the SoundSystem is
instantiated, then an instance of the base SoundSystemLogger class will be
used by default.l - Handle to a message logger.public static SoundSystemLogger getLogger()
public static void setNumberNormalChannels(int number)
number - How many normal audio channels.public static int getNumberNormalChannels()
public static void setNumberStreamingChannels(int number)
number - How many streaming audio channels.public static int getNumberStreamingChannels()
public static void setMasterGain(float value)
value - Float value (0.0f - 1.0f).public static float getMasterGain()
public static void setDefaultAttenuation(int model)
model - A global attenuation model identifier.public static int getDefaultAttenuation()
public static void setDefaultRolloff(float rolloff)
rolloff - Rolloff factor.public static float getDopplerFactor()
public static void setDopplerFactor(float factor)
factor - Doppler factor.public static float getDopplerVelocity()
public static void setDopplerVelocity(float velocity)
velocity - Doppler velocity.public static float getDefaultRolloff()
public static void setDefaultFadeDistance(float distance)
distance - Fade Distance.public static float getDefaultFadeDistance()
public static void setSoundFilesPackage(String location)
location - Path to the sound files location (must be followed by '/').public static String getSoundFilesPackage()
public static void setStreamingBufferSize(int size)
size - Size in bytes.public static int getStreamingBufferSize()
public static void setNumberStreamingBuffers(int num)
num - How many buffers.public static int getNumberStreamingBuffers()
public static void setMaxFileSize(int size)
size - Size in bytes.public static int getMaxFileSize()
public static void setFileChunkSize(int size)
size - Size in bytes.public static int getFileChunkSize()
public static String getOverrideMIDISynthesizer()
public static void setOverrideMIDISynthesizer(String name)
name - All or part of the MIDI device name.public static void setCodec(String extension, Class iCodecClass) throws SoundSystemException
extension - File extension to be associated with the specified codec.iCodecClass - Codec type to use for files with the specified extension.SoundSystemExceptionpublic static ICodec getCodec(String filename)
filename - File to get a codec for.public static boolean midiCodec()
public static void addStreamListener(IStreamListener streamListener)
streamListener - Implementation of interface 'IStreamListener'.public static void removeStreamListener(IStreamListener streamListener)
streamListener - Implementation of interface 'IStreamListener'.public static void notifyEOS(String sourcename, int queueSize)
sourcename - String identifier of the source which reached the EOS.queueSize - Number of items left the the stream's play queue, or zero if none.Copyright © 2017. All rights reserved.