public interface ISoundEngine
| Modifier and Type | Method and Description |
|---|---|
float |
getMaxDistance()
Gets the maximum distance from the listener at which a sound source can
still be heard.
|
ISoundPlayback |
playMusic(Sound sound)
Loops the specified sound file as background music.
|
ISoundPlayback |
playMusic(Sound sound,
boolean loop)
Plays the specified sound file as background music.
|
ISoundPlayback |
playSound(IEntity entity,
Sound sound)
Plays the specified sound and updates its volume and pan by the current
entity location in relation to the listener location.
|
ISoundPlayback |
playSound(IEntity entity,
Sound sound,
boolean loop)
Plays the specified sound and updates its volume and pan by the current
entity location in relation to the listener location.
|
ISoundPlayback |
playSound(java.awt.geom.Point2D location,
Sound sound)
Plays the specified sound at the specified location and updates the volume
and pan in relation to the listener location.
|
ISoundPlayback |
playSound(java.awt.geom.Point2D location,
Sound sound,
boolean loop)
Plays the specified sound at the specified location and updates the volume
and pan in relation to the listener location.
|
ISoundPlayback |
playSound(Sound sound)
Plays the specified sound with the volume configured in the SOUND config
with a center pan.
|
ISoundPlayback |
playSound(Sound sound,
boolean loop)
Plays the specified sound with the volume configured in the SOUND config
with a center pan.
|
void |
setListenerLocationCallback(java.util.function.Function<java.awt.geom.Point2D,java.awt.geom.Point2D> listenerLocationCallback)
This method allows to set the callback that is used by the SoundEngine to
determine where the listener location is.
|
void |
setMaxDistance(float distance)
Sets the maximum distance from the listener at which a sound source can
still be heard.
|
void |
stopMusic()
Stops the playback of the current background music.
|
float getMaxDistance()
ISoundPlayback playMusic(Sound sound)
sound - The sound from which to play the background music.ISoundPlayback instance that allows to further process
and control the played sound.ISoundPlayback playMusic(Sound sound, boolean loop)
sound - The sound from which to play the background music.loop - Determines whether this playback should be looped or not.ISoundPlayback instance that allows to further process
and control the played sound.ISoundPlayback playSound(IEntity entity, Sound sound)
entity - The entity at which location the sound should be played.sound - The sound to play.ISoundPlayback instance that allows to further process
and control the played sound.ISoundPlayback playSound(IEntity entity, Sound sound, boolean loop)
entity - The entity at which location the sound should be played.sound - The sound to play.loop - Determines whether this playback should be looped or not.ISoundPlayback instance that allows to further process
and control the played sound.ISoundPlayback playSound(java.awt.geom.Point2D location, Sound sound)
location - The location at which to play the sound.sound - The sound to play.ISoundPlayback instance that allows to further process
and control the played sound.ISoundPlayback playSound(java.awt.geom.Point2D location, Sound sound, boolean loop)
location - The location at which to play the sound.sound - The sound to play.loop - Determines whether this playback should be looped or not.ISoundPlayback instance that allows to further process
and control the played sound.ISoundPlayback playSound(Sound sound)
sound - The sound to play.ISoundPlayback instance that allows to further process
and control the played sound.ISoundPlayback playSound(Sound sound, boolean loop)
sound - The sound to play.loop - Determines whether this playback should be looped or not.ISoundPlayback instance that allows to further process
and control the played sound.void setMaxDistance(float distance)
distance - The maximum distance at which sounds can still be heard.void stopMusic()
void setListenerLocationCallback(java.util.function.Function<java.awt.geom.Point2D,java.awt.geom.Point2D> listenerLocationCallback)
listenerLocationCallback - The callback that determines the location of the sound listener.