public class AudioManagerImpl extends Object implements AudioManager
| Constructor and Description |
|---|
AudioManagerImpl(GameCamera gameCamera,
aurelienribon.tweenengine.TweenManager tweenManager,
GameWorld gameWorld,
BehaviorManager behaviorManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all audio.
|
void |
clearMusic()
Clears all music and removes all related objects from the
GameWorld. |
void |
clearSounds()
Clears all sounds and removed all related objects from the
GameWorld. |
void |
crossFadeMusic(com.badlogic.gdx.audio.Music from,
com.badlogic.gdx.audio.Music to,
float duration)
Fades music from one music to another
|
void |
crossFadeMusic(String fromPath,
String toPath)
Fades music from one music to another
|
void |
crossFadeMusic(String fromPath,
String toPath,
float duration)
Fades music from one music to another
|
void |
fadeInMusic(com.badlogic.gdx.audio.Music music,
float duration)
Fades in music
|
void |
fadeInMusic(String path)
Fades in music
|
void |
fadeInMusic(String path,
float duration)
Fades in music
|
void |
fadeOutMusic(com.badlogic.gdx.audio.Music music,
float duration)
Fades out music
|
void |
fadeOutMusic(String path)
Fades out music
|
void |
fadeOutMusic(String path,
float duration)
Fades out music
|
void |
pauseMusic(String path)
Pauses given music.
|
void |
playMusic(String path)
Plays a given music.
|
void |
setMasterVolume(float volume)
Sets a new master volume.
|
void |
spawnMusic(String path,
float x,
float y,
float volume,
float hearingRange)
Spawns a
Music in the world. |
void |
spawnSound(String path,
float x,
float y,
float pitch,
float volume,
float hearingRange)
plays a sound in the
GameWorld relative to the GameCamera. |
void |
spawnSoundLooped(String path,
float x,
float y,
float pitch,
float volume,
float hearingRange)
|
void |
spawnSoundLooped(String path,
GameObject target,
float pitch,
float volume,
float hearingRange)
|
void |
stopMusic(String path)
Stops given music.
|
public AudioManagerImpl(GameCamera gameCamera, aurelienribon.tweenengine.TweenManager tweenManager, GameWorld gameWorld, BehaviorManager behaviorManager)
public void spawnSound(String path, float x, float y, float pitch, float volume, float hearingRange)
AudioManagerGameWorld relative to the GameCamera.spawnSound in interface AudioManagerpath - the path of the audio filex - the horizontal position in the worldy - the vertical position in the worldpitch - the audio pitchvolume - the audio volume. FinalVolume=MasterVolume*volume*directionalVolumehearingRange - the hearing range where the audio is hearable frompublic void spawnSoundLooped(String path, float x, float y, float pitch, float volume, float hearingRange)
AudioManagerSound in the GameWorld relative to the GameCamera. The sound object is removed as soon the sound has stopped playing.spawnSoundLooped in interface AudioManagerpath - the path of the audio filex - the horizontal position in the worldy - the vertical position in the worldpitch - the audio pitchvolume - the audio volume. FinalVolume=MasterVolume*volume*directionalVolumehearingRange - the hearing range where the audio is hearable frompublic void spawnSoundLooped(String path, GameObject target, float pitch, float volume, float hearingRange)
AudioManagerSound in the GameWorld relative to the GameCamera. The sound object is removed as soon the sound has stopped playing.spawnSoundLooped in interface AudioManagerpath - the path of the audio filetarget - the target to attach the sound topitch - the audio pitchvolume - the audio volume. FinalVolume=MasterVolume*volume*directionalVolumehearingRange - the hearing range where the audio is hearable frompublic void spawnMusic(String path, float x, float y, float volume, float hearingRange)
AudioManagerMusic in the world. The music persists until it is deleted via clearMusic.spawnMusic in interface AudioManagerpath - the path of the audio filex - the horizontal position in the worldy - the vertical position in the worldvolume - the audio volume. FinalVolume=MasterVolume*volume*directionalVolumehearingRange - the hearing range where the audio is hearable frompublic void clearMusic()
AudioManagerGameWorld.clearMusic in interface AudioManagerpublic void clearSounds()
AudioManagerGameWorld.clearSounds in interface AudioManagerpublic void clear()
AudioManagerclear in interface AudioManagerpublic void setMasterVolume(float volume)
AudioManager1.0setMasterVolume in interface AudioManagervolume - the master volumepublic void crossFadeMusic(String fromPath, String toPath)
AudioManagercrossFadeMusic in interface AudioManagerfromPath - the source audiotoPath - the target audiopublic void crossFadeMusic(String fromPath, String toPath, float duration)
AudioManagercrossFadeMusic in interface AudioManagerfromPath - the source audiotoPath - the target audioduration - the duration in secondspublic void crossFadeMusic(com.badlogic.gdx.audio.Music from,
com.badlogic.gdx.audio.Music to,
float duration)
AudioManagercrossFadeMusic in interface AudioManagerduration - the duration in secondspublic void fadeOutMusic(String path)
AudioManagerfadeOutMusic in interface AudioManagerpath - the path to the music filepublic void fadeOutMusic(String path, float duration)
AudioManagerfadeOutMusic in interface AudioManagerpath - the path to the music fileduration - the duration in secondspublic void fadeOutMusic(com.badlogic.gdx.audio.Music music,
float duration)
AudioManagerfadeOutMusic in interface AudioManagerduration - the duration in secondspublic void fadeInMusic(String path)
AudioManagerfadeInMusic in interface AudioManagerpath - the path to the music filepublic void fadeInMusic(String path, float duration)
AudioManagerfadeInMusic in interface AudioManagerpath - the path to the music fileduration - the duration in secondspublic void fadeInMusic(com.badlogic.gdx.audio.Music music,
float duration)
AudioManagerfadeInMusic in interface AudioManagerduration - the duration in secondspublic void playMusic(String path)
AudioManagerplayMusic in interface AudioManagerpath - the path to the audio filepublic void stopMusic(String path)
AudioManagerstopMusic in interface AudioManagerpath - the path to the audio filepublic void pauseMusic(String path)
AudioManagerpauseMusic in interface AudioManagerpath - the path to the audio fileCopyright © 2020. All rights reserved.