APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.backends.lwjgl.audio

public Class OpenALAudioDevice

extends Object
implements AudioDevice
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.audio.AudioDevice, com.badlogic.gdx.utils.Disposable
Imports
java.nio.Buffer, .ByteBuffer, .IntBuffer, org.lwjgl.BufferUtils, org.lwjgl.openal.AL11, com.badlogic.gdx.audio.AudioDevice, com.badlogic.gdx.math.MathUtils, com.badlogic.gdx.utils.GdxRuntimeException

Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
private final OpenALLwjglAudio
private final int
private IntBuffer
private final int
private byte[]
private static final int
private final int
private int
private boolean
private float
private int
private float
private int
private final ByteBuffer
private float

Constructor Summary

AccessConstructor and Description
public
OpenALAudioDevice(OpenALLwjglAudio audio, int sampleRate, boolean isMono, int bufferSize, int bufferCount)

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements com.badlogic.gdx.audio.AudioDevice.dispose.

Frees all resources associated with this AudioDevice.

private int
fillBuffer(byte[] data, int offset, int length)

Blocks until some of the data could be buffered.

public int
public int
public float
public int
public boolean
public boolean
public void
pause()

Implements com.badlogic.gdx.audio.AudioDevice.pause.

Pauses the audio device if supported

public void
resume()

Implements com.badlogic.gdx.audio.AudioDevice.resume.

Unpauses the audio device if supported

public void
setPosition(float position)

public void
setVolume(float volume)

Implements com.badlogic.gdx.audio.AudioDevice.setVolume.

Sets the volume in the range [0,1].

public void
stop()

public void
writeSamples(short[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of 16-bit signed PCM samples to the audio device and blocks until they have been processed.

public void
writeSamples(float[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of float PCM samples to the audio device and blocks until they have been processed.

public void
writeSamples(byte[] data, int offset, int length)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

audioback to summary
private final OpenALLwjglAudio audio
bufferCountback to summary
private final int bufferCount
buffersback to summary
private IntBuffer buffers
bufferSizeback to summary
private final int bufferSize
bytesback to summary
private byte[] bytes
bytesPerSampleback to summary
private static final int bytesPerSample
channelsback to summary
private final int channels
formatback to summary
private int format
isPlayingback to summary
private boolean isPlaying
renderedSecondsback to summary
private float renderedSeconds
sampleRateback to summary
private int sampleRate
secondsPerBufferback to summary
private float secondsPerBuffer
sourceIDback to summary
private int sourceID
tempBufferback to summary
private final ByteBuffer tempBuffer
volumeback to summary
private float volume

Constructor Detail

OpenALAudioDeviceback to summary
public OpenALAudioDevice(OpenALLwjglAudio audio, int sampleRate, boolean isMono, int bufferSize, int bufferCount)

Method Detail

disposeback to summary
public void dispose()

Implements com.badlogic.gdx.audio.AudioDevice.dispose.

Doc from com.badlogic.gdx.audio.AudioDevice.dispose.

Frees all resources associated with this AudioDevice. Needs to be called when the device is no longer needed.

fillBufferback to summary
private int fillBuffer(byte[] data, int offset, int length)

Blocks until some of the data could be buffered.

getChannelsback to summary
public int getChannels()
getLatencyback to summary
public int getLatency()

Implements com.badlogic.gdx.audio.AudioDevice.getLatency.

getPositionback to summary
public float getPosition()
getRateback to summary
public int getRate()
isMonoback to summary
public boolean isMono()

Implements com.badlogic.gdx.audio.AudioDevice.isMono.

isPlayingback to summary
public boolean isPlaying()
pauseback to summary
public void pause()

Implements com.badlogic.gdx.audio.AudioDevice.pause.

Doc from com.badlogic.gdx.audio.AudioDevice.pause.

Pauses the audio device if supported

Annotations
@Override
resumeback to summary
public void resume()

Implements com.badlogic.gdx.audio.AudioDevice.resume.

Doc from com.badlogic.gdx.audio.AudioDevice.resume.

Unpauses the audio device if supported

Annotations
@Override
setPositionback to summary
public void setPosition(float position)
setVolumeback to summary
public void setVolume(float volume)

Implements com.badlogic.gdx.audio.AudioDevice.setVolume.

Doc from com.badlogic.gdx.audio.AudioDevice.setVolume.

Sets the volume in the range [0,1].

stopback to summary
public void stop()
writeSamplesback to summary
public void writeSamples(short[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Doc from com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of 16-bit signed PCM samples to the audio device and blocks until they have been processed.

writeSamplesback to summary
public void writeSamples(float[] samples, int offset, int numSamples)

Implements com.badlogic.gdx.audio.AudioDevice.writeSamples.

Doc from com.badlogic.gdx.audio.AudioDevice.writeSamples.

Writes the array of float PCM samples to the audio device and blocks until they have been processed.

writeSamplesback to summary
public void writeSamples(byte[] data, int offset, int length)