public class Mini2DxOpenALAudio extends java.lang.Object implements Mini2DxAudio
OpenALAudio
to support sound completion eventsConstructor and Description |
---|
Mini2DxOpenALAudio() |
Mini2DxOpenALAudio(int simultaneousSources,
int deviceBufferCount,
int deviceBufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
addSoundCompletionListener(SoundCompletionListener listener)
Adds a
SoundCompletionListener to listen for sound effect completion events |
void |
appendRecentSoundId(long soundId) |
void |
dispose()
Disposes of allocated audio resources
|
void |
forget(Mini2DxOpenALSound sound)
Removes the disposed sound from the least recently played list
|
long |
getSoundId(int sourceId) |
boolean |
isSoundPlaying(long soundId) |
com.badlogic.gdx.audio.AudioDevice |
newAudioDevice(int sampleRate,
boolean isMono) |
com.badlogic.gdx.audio.AudioRecorder |
newAudioRecorder(int samplingRate,
boolean isMono) |
Mini2DxOpenALMusic |
newMusic(com.badlogic.gdx.files.FileHandle file) |
Mini2DxOpenALSound |
newSound(com.badlogic.gdx.files.FileHandle file) |
void |
pauseSound(long soundId) |
void |
registerMusic(java.lang.String extension,
java.lang.Class<? extends Mini2DxOpenALMusic> musicClass) |
void |
registerSound(java.lang.String extension,
java.lang.Class<? extends Mini2DxOpenALSound> soundClass) |
void |
removeSoundCompletionListener(SoundCompletionListener listener)
Removes a
SoundCompletionListener |
void |
resumeSound(long soundId) |
protected void |
retain(Mini2DxOpenALSound sound,
boolean stop)
Retains a list of the most recently played sounds and stops the sound played
least recently if necessary for a new sound to play
|
void |
setSoundGain(long soundId,
float volume) |
void |
setSoundLooping(long soundId,
boolean looping) |
void |
setSoundPan(long soundId,
float pan,
float volume) |
void |
setSoundPitch(long soundId,
float pitch) |
void |
stopSound(long soundId) |
void |
update()
Updates the audio device and events
|
public Mini2DxOpenALAudio()
public Mini2DxOpenALAudio(int simultaneousSources, int deviceBufferCount, int deviceBufferSize)
public void addSoundCompletionListener(SoundCompletionListener listener)
Mini2DxAudio
SoundCompletionListener
to listen for sound effect completion eventsaddSoundCompletionListener
in interface Mini2DxAudio
listener
- The SoundCompletionListener
implementation to addpublic void removeSoundCompletionListener(SoundCompletionListener listener)
Mini2DxAudio
SoundCompletionListener
removeSoundCompletionListener
in interface Mini2DxAudio
listener
- The SoundCompletionListener
implementation to removepublic void registerSound(java.lang.String extension, java.lang.Class<? extends Mini2DxOpenALSound> soundClass)
public void registerMusic(java.lang.String extension, java.lang.Class<? extends Mini2DxOpenALMusic> musicClass)
public Mini2DxOpenALSound newSound(com.badlogic.gdx.files.FileHandle file)
newSound
in interface com.badlogic.gdx.Audio
public Mini2DxOpenALMusic newMusic(com.badlogic.gdx.files.FileHandle file)
newMusic
in interface com.badlogic.gdx.Audio
public void update()
Mini2DxAudio
update
in interface Mini2DxAudio
public void appendRecentSoundId(long soundId)
public boolean isSoundPlaying(long soundId)
public long getSoundId(int sourceId)
public void stopSound(long soundId)
public void pauseSound(long soundId)
public void resumeSound(long soundId)
public void setSoundGain(long soundId, float volume)
public void setSoundLooping(long soundId, boolean looping)
public void setSoundPitch(long soundId, float pitch)
public void setSoundPan(long soundId, float pan, float volume)
public void dispose()
Mini2DxAudio
dispose
in interface Mini2DxAudio
public com.badlogic.gdx.audio.AudioDevice newAudioDevice(int sampleRate, boolean isMono)
newAudioDevice
in interface com.badlogic.gdx.Audio
public com.badlogic.gdx.audio.AudioRecorder newAudioRecorder(int samplingRate, boolean isMono)
newAudioRecorder
in interface com.badlogic.gdx.Audio
protected void retain(Mini2DxOpenALSound sound, boolean stop)
public void forget(Mini2DxOpenALSound sound)