Package org.indiumstudios.keylib.Sound
Class Audio
java.lang.Object
org.indiumstudios.keylib.Sound.Audio
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAudio(com.badlogic.gdx.files.FileHandle fileHandle, Audio.SoundType type, boolean isLooping, float volume) An audio clip whether it is music or a sound effect. -
Method Summary
-
Constructor Details
-
Audio
public Audio(com.badlogic.gdx.files.FileHandle fileHandle, Audio.SoundType type, boolean isLooping, float volume) An audio clip whether it is music or a sound effect.- Parameters:
fileHandle- The file handle (ex: Gdx.files.internal).type- The type of the sound. Music: SoundType.MUSIC, Sound Effect: SoundType.SOUND_EFFECT.isLooping- If the sound is looping or not.volume- The volume of the sound. Usually at 0.2 for normal volume
-
-
Method Details
-
play
public void play()Plays the sound. -
stop
public void stop()Stops the sound. -
pause
public void pause()Pauses the sound. -
isPlaying
public boolean isPlaying()Checks if the music is playing or not.- Returns:
- Returns if the music is playing or not.
-
dispose
public void dispose()Disposes the sound. Do this when you don't need the sound anymore.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-