|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectespresso3d.engine.base.E3DEngineItem
espresso3d.engine.sound.E3DSoundHandler
| Constructor Summary | |
E3DSoundHandler(E3DEngine engine)
|
|
| Method Summary | |
void |
addSound(E3DSound sound)
Adds a sound to the preloaded sound list. |
void |
discardOldSounds()
This is called by the engine to iterate through all playing sounds that have been set to play and ensure they are still playing. |
E3DSound |
getSound(java.lang.String soundName)
|
boolean |
isSoundPaused(E3DSound sound)
Checks if a sound is paused or not using the AL state of the sound. |
boolean |
isSoundPlaying(E3DSound sound)
Checks if a sound is playing or not. |
boolean |
isSoundStopped(E3DSound sound)
Checks if a sound is stopped or not. |
void |
loadSoundSet(java.lang.String soundSetFileName,
boolean fromJar)
Loads the soundSet into memory. |
E3DSound2D |
loop2DSound(java.lang.String soundName,
double pitch,
double volume)
Loops a 2D sound, or a sound that has no position, until it is manually stopped. |
E3DSound3D |
loop3DSound(java.lang.String soundName,
E3DActor sourceActor,
double pitch,
double volume,
double referenceDistance,
double maxDistance,
double falloffFactor)
Loops the specified until manually stoppped and binds it to the sourceActor so as the sourceActor moves, the sound will also move. |
void |
pauseSound(E3DSound sound)
Pauses a sound. |
E3DSound2D |
play2DSound(java.lang.String soundName,
double pitch,
double volume)
Plays a 2D sound, or a sound that has no position, 1 time. |
E3DSound3D |
play3DSound(java.lang.String soundName,
E3DActor sourceActor,
double pitch,
double volume,
double referenceDistance,
double maxDistance,
double falloffFactor)
Plays the specified sound 1 time and binds it to the sourceActor so as the sourceActor moves, the sound will also move. |
void |
removeAllSounds()
|
void |
removeSound(E3DSound sound)
|
void |
removeSound(java.lang.String soundName)
|
void |
rewindSound(E3DSound sound)
Rewinds a sound to the beginning. |
void |
setListener(E3DActor listenerActor)
Usually automatically called by the engine to be the current viewports camera actor |
void |
stopSound(E3DSound sound)
This can be used to stop any sound, 2D or 3D by passing the sound object returned when the sound was set to play or loop. |
void |
unpauseSound(E3DSound sound)
Unpauses a paused sound. |
void |
update3DSoundOrientation(E3DSound3D sound3D,
E3DVector3F velocity)
Updates the sounds position and velocity to be that of its source actor. |
| Methods inherited from class espresso3d.engine.base.E3DEngineItem |
getEngine, setEngine |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public E3DSoundHandler(E3DEngine engine)
throws org.lwjgl.LWJGLException
| Method Detail |
public E3DSound getSound(java.lang.String soundName)
public void addSound(E3DSound sound)
sound - public void removeSound(java.lang.String soundName)
public void removeSound(E3DSound sound)
public void removeAllSounds()
public void loadSoundSet(java.lang.String soundSetFileName,
boolean fromJar)
throws E3DMissingEngineException,
E3DInvalidFileFormatException,
E3DInvalidSoundFormatException,
java.io.IOException
fromJar -
E3DMissingEngineException
E3DInvalidFileFormatException
E3DInvalidSoundFormatException
java.io.IOException
public E3DSound3D play3DSound(java.lang.String soundName,
E3DActor sourceActor,
double pitch,
double volume,
double referenceDistance,
double maxDistance,
double falloffFactor)
throws E3DSoundOutOfSourcesException
soundName - The name given to the sound that was loaded from the soundset (or manually)sourceActor - The actor this sound will be bound to (so when the actor moves, this sound moves with it)pitch - The pitch of the sound when it is playedvolume - The volume of the sound when it is playedreferenceDistance - This is the distance away you can be from the object and hear the sound at full volume (volume variable)maxDistance - The maximum distance away you can hear the soundfalloffFactor - A falloff scalar. The higher this is, the faster the sound will falloff. Usually use 1
E3DSoundOutOfSourcesException - - This is a completely recoverable exception and is used to indicate
that the engine is temporarily out of sources for sounds (ie: too many playing at one time). As a sound stops,
the engine will free up that source for later use so sources will free up (unless they are all looping and never stop, in which case
if you really need a sound you should handle this and stop one to free it up)
public E3DSound3D loop3DSound(java.lang.String soundName,
E3DActor sourceActor,
double pitch,
double volume,
double referenceDistance,
double maxDistance,
double falloffFactor)
throws E3DSoundOutOfSourcesException
soundName - The name given to the sound that was loaded from the soundset (or manually)sourceActor - The actor this sound will be bound to (so when the actor moves, this sound moves with it)pitch - The pitch of the sound when it is playedvolume - The volume of the sound when it is playedreferenceDistance - This is the distance away you can be from the object and hear the sound at full volume (volume variable)maxDistance - The maximum distance away you can hear the soundfalloffFactor - A falloff scalar. The higher this is, the faster the sound will falloff. Usually use 1
E3DSoundOutOfSourcesException - - This is a completely recoverable exception and is used to indicate
that the engine is temporarily out of sources for sounds (ie: too many playing at one time). As a sound stops,
the engine will free up that source for later use so sources will free up (unless they are all looping and never stop, in which case
if you really need a sound you should handle this and stop one to free it up)
public E3DSound2D play2DSound(java.lang.String soundName,
double pitch,
double volume)
throws E3DSoundOutOfSourcesException
soundName - The name given to the sound that was loaded from the soundset (or manually)pitch - The pitch of the sound when it is playedvolume - The volume of the sound when it is played
E3DSoundOutOfSourcesException - - This is a completely recoverable exception and is used to indicate
that the engine is temporarily out of sources for sounds (ie: too many playing at one time). As a sound stops,
the engine will free up that source for later use so sources will free up (unless they are all looping and never stop, in which case
if you really need a sound you should handle this and stop one to free it up)
public E3DSound2D loop2DSound(java.lang.String soundName,
double pitch,
double volume)
throws E3DSoundOutOfSourcesException
soundName - The name given to the sound that was loaded from the soundset (or manually)pitch - The pitch of the sound when it is playedvolume - The volume of the sound when it is played
E3DSoundOutOfSourcesException - - This is a completely recoverable exception and is used to indicate
that the engine is temporarily out of sources for sounds (ie: too many playing at one time). As a sound stops,
the engine will free up that source for later use so sources will free up (unless they are all looping and never stop, in which case
if you really need a sound you should handle this and stop one to free it up)public void discardOldSounds()
public void stopSound(E3DSound sound)
sound - An instance of a sound - not a preloaded sound.public void pauseSound(E3DSound sound)
sound - public void unpauseSound(E3DSound sound)
sound - An instance of a sound - not a preloaded sound.public void rewindSound(E3DSound sound)
sound - An instance of a sound - not a preloaded sound.public boolean isSoundPlaying(E3DSound sound)
sound - The sound to check
public boolean isSoundPaused(E3DSound sound)
sound -
public boolean isSoundStopped(E3DSound sound)
sound -
public void update3DSoundOrientation(E3DSound3D sound3D,
E3DVector3F velocity)
velocity - public void setListener(E3DActor listenerActor)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||