public class LibraryJavaSound extends Library
| Modifier and Type | Class and Description |
|---|---|
static class |
LibraryJavaSound.Exception
The LibraryJavaSound.Exception class provides library-specific error
information.
|
static class |
LibraryJavaSound.MixerRanking
The MixerRanking class is used to determine the capabilities of a mixer,
and to give it a ranking based on the priority of those capabilities.
|
bufferMap, listener, normalChannels, reverseByteOrder, sourceMap, streamingChannels, streamThread| Constructor and Description |
|---|
LibraryJavaSound()
Constructor: Instantiates the source map, buffer map and listener
information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Stops all sources, and removes references to all instantiated objects.
|
void |
copySources(HashMap<String,Source> srcMap)
Creates sources based on the source map provided.
|
protected Channel |
createChannel(int type)
Creates a new channel of the specified type (normal or streaming).
|
void |
dopplerChanged()
The Doppler parameters have changed.
|
String |
getClassName()
Returns the name of the class.
|
static String |
getDescription()
Returns a longer description of this library type.
|
static Mixer |
getMixer()
Returns a handle to the current JavaSound mixer, or null if no mixer has
been set yet.
|
static LibraryJavaSound.MixerRanking |
getMixerRanking() |
static String |
getTitle()
Returns the short title of this library type.
|
void |
init()
Initializes Javasound.
|
static boolean |
libraryCompatible()
Checks if the JavaSound library type is compatible.
|
boolean |
loadSound(FilenameURL filenameURL)
Pre-loads a sound into memory.
|
boolean |
loadSound(SoundBuffer buffer,
String identifier)
Saves the specified sample data, under the specified identifier.
|
void |
newSource(boolean priority,
boolean toStream,
boolean toLoop,
String sourcename,
FilenameURL filenameURL,
float x,
float y,
float z,
int attModel,
float distOrRoll)
Creates a new source and places it into the source map.
|
void |
quickPlay(boolean priority,
boolean toStream,
boolean toLoop,
String sourcename,
FilenameURL filenameURL,
float x,
float y,
float z,
int attModel,
float distOrRoll,
boolean temporary)
Creates and immediately plays a new source.
|
void |
rawDataStream(AudioFormat audioFormat,
boolean priority,
String sourcename,
float x,
float y,
float z,
int attModel,
float distOrRoll)
Opens a direct line for streaming audio data.
|
static void |
setLineCount(int value) |
void |
setListenerVelocity(float x,
float y,
float z)
Sets the listener's velocity, for use in Doppler effect.
|
void |
setMasterVolume(float value)
Sets the overall volume to the specified value, affecting all sources.
|
static void |
setMaxSampleRate(int value) |
static void |
setMinSampleRate(int value) |
static void |
setMixer(Mixer m)
Sets the current mixer.
|
static void |
useGainControl(boolean value) |
static void |
usePanControl(boolean value) |
static void |
useSampleRateControl(boolean value) |
activate, checkFadeVolumes, cull, dequeueSound, errorCheck, errorMessage, fadeOut, fadeOutIn, feedRawAudioData, feedRawAudioData, flush, getAllLoadedFilenames, getAllSourcenames, getListenerData, getMidiChannel, getPitch, getSource, getSources, getVolume, importantMessage, listenerMoved, loadMidi, message, midiSourcename, millisecondsPlayed, moveListener, pause, play, play, printStackTrace, queueSound, removeSource, removeTemporarySources, replaySources, reverseByteOrder, rewind, setAttenuation, setDistOrRoll, setListenerAngle, setListenerData, setListenerOrientation, setListenerPosition, setLooping, setMidiChannel, setPitch, setPosition, setPriority, setTemporary, setVelocity, setVolume, stop, turnListener, unloadMidi, unloadSoundpublic LibraryJavaSound()
throws SoundSystemException
SoundSystemExceptionpublic void init()
throws SoundSystemException
init in class LibrarySoundSystemExceptionpublic static boolean libraryCompatible()
protected Channel createChannel(int type)
SoundSystemConfig class.createChannel in class Librarytype - Type of channel.public void cleanup()
public boolean loadSound(FilenameURL filenameURL)
public boolean loadSound(SoundBuffer buffer, String identifier)
public void setMasterVolume(float value)
setMasterVolume in class Libraryvalue - New volume, float value ( 0.0f - 1.0f ).public void newSource(boolean priority,
boolean toStream,
boolean toLoop,
String sourcename,
FilenameURL filenameURL,
float x,
float y,
float z,
int attModel,
float distOrRoll)
newSource in class Librarypriority - Setting this to true will prevent other sounds from overriding this one.toStream - Setting this to true will load the sound in pieces rather than all at once.toLoop - Should this source loop, or play only once.sourcename - A unique identifier for this source. Two sources may not use the same sourcename.filenameURL - Filename/URL of the sound file to play at this source.x - X position for this source.y - Y position for this source.z - Z position for this source.attModel - Attenuation model to use.distOrRoll - Either the fading distance or rolloff factor, depending on the value of "attmodel".public void rawDataStream(AudioFormat audioFormat, boolean priority, String sourcename, float x, float y, float z, int attModel, float distOrRoll)
rawDataStream in class LibraryaudioFormat - Format that the data will be in.priority - Setting this to true will prevent other sounds from overriding this one.sourcename - A unique identifier for this source. Two sources may not use the same sourcename.x - X position for this source.y - Y position for this source.z - Z position for this source.attModel - Attenuation model to use.distOrRoll - Either the fading distance or rolloff factor, depending on the value of "attmodel".public void quickPlay(boolean priority,
boolean toStream,
boolean toLoop,
String sourcename,
FilenameURL filenameURL,
float x,
float y,
float z,
int attModel,
float distOrRoll,
boolean temporary)
quickPlay in class Librarypriority - Setting this to true will prevent other sounds from overriding this one.toStream - Setting this to true will load the sound in pieces rather than all at once.toLoop - Should this source loop, or play only once.sourcename - A unique identifier for this source. Two sources may not use the same sourcename.filenameURL - Filename/URL of the sound file to play at this source.x - X position for this source.y - Y position for this source.z - Z position for this source.attModel - Attenuation model to use.distOrRoll - Either the fading distance or rolloff factor, depending on the value of "attmodel".temporary - Whether or not this source should be removed after it finishes playing.public void copySources(HashMap<String,Source> srcMap)
copySources in class LibrarysrcMap - Sources to copy.public void setListenerVelocity(float x,
float y,
float z)
setListenerVelocity in class Libraryx - Velocity along world x-axis.y - Velocity along world y-axis.z - Velocity along world z-axis.public void dopplerChanged()
dopplerChanged in class Librarypublic static Mixer getMixer()
public static void setMixer(Mixer m) throws SoundSystemException
m - New mixer.SoundSystemExceptionpublic static LibraryJavaSound.MixerRanking getMixerRanking()
public static void setMinSampleRate(int value)
public static void setMaxSampleRate(int value)
public static void setLineCount(int value)
public static void useGainControl(boolean value)
public static void usePanControl(boolean value)
public static void useSampleRateControl(boolean value)
public static String getTitle()
public static String getDescription()
public String getClassName()
getClassName in class LibraryCopyright © 2017. All rights reserved.