Skip to content

Lwjgl3AlBinding

final class Lwjgl3AlBinding
Implements: IAlBinding
Package: dev.joid.base.lwjgl3.openal · Module: base-lwjgl3-openal · Source: Lwjgl3AlBinding.java
Backends: LWJGL 3 Vulkan

The OpenAL binding of LWJGL 3, given to AlAudioBridge by the LWJGL 3 and Vulkan backends.

ReturnsSignatureSummary
Lwjgl3AlBindinginst() factoryReturns the only instance.

ReturnsSignatureSummary
ObjectgetCurrentContext()Returns the OpenAL capabilities of the current context, or null when no context is current.
booleanisPlaying(int source)Calls alGetSourcei with AL_SOURCE_STATE.
intgetQueuedBuffers(int source)Calls alGetSourcei with AL_BUFFERS_QUEUED.
intgetProcessedBuffers(int source)Calls alGetSourcei with AL_BUFFERS_PROCESSED.
ReturnsSignatureSummary
voidcreateContext()Opens the default device with alcOpenDevice, creates a context on it and makes it current.
intgenSource()Calls alGenSources, then places the source at the listener with AL_SOURCE_RELATIVE and a position of zero.
voiddeleteSource(int source)Calls alDeleteSources.
intgenBuffer()Calls alGenBuffers.
voiddeleteBuffer(int buffer)Calls alDeleteBuffers.
voidbufferData(int buffer, int channels, short[] samples, int sampleRate)Calls alBufferData with AL_FORMAT_MONO16 or AL_FORMAT_STEREO16.
voidplay(int source)Calls alSourcePlay.
voidstop(int source)Calls alSourceStop.
voidpause(int source)Calls alSourcePause.
voidgain(int source, float gain)Calls alSourcef with AL_GAIN.
voidqueueBuffer(int source, int buffer)Calls alSourceQueueBuffers.
intunqueueBuffer(int source)Calls alSourceUnqueueBuffers.
voiddestroyContext()Releases the current context when it is its own, destroys it and closes the device; does nothing when it created none.

Lwjgl3AlBinding inst() factory

Returns the only instance.

Object getCurrentContext()

Returns the OpenAL capabilities of the current context, or null when no context is current.

boolean isPlaying(int source)

Calls alGetSourcei with AL_SOURCE_STATE.

int getQueuedBuffers(int source)

Calls alGetSourcei with AL_BUFFERS_QUEUED.

int getProcessedBuffers(int source)

Calls alGetSourcei with AL_BUFFERS_PROCESSED.

void createContext()

Throws:

  • IllegalStateException: OpenAL cannot open the default audio device, check that an audio output device is connected and enabled
  • IllegalStateException: OpenAL cannot create a context on the default audio device, check that no other application holds it exclusively and that its driver is up to date

Opens the default device with alcOpenDevice, creates a context on it and makes it current. Throws an IllegalStateException when no output device opens, or when the device refuses a context.

int genSource()

Calls alGenSources, then places the source at the listener with AL_SOURCE_RELATIVE and a position of zero.

void deleteSource(int source)

Calls alDeleteSources.

int genBuffer()

Calls alGenBuffers.

void deleteBuffer(int buffer)

Calls alDeleteBuffers.

void bufferData(int buffer, int channels, short[] samples, int sampleRate)

Calls alBufferData with AL_FORMAT_MONO16 or AL_FORMAT_STEREO16.

void play(int source)

Calls alSourcePlay.

void stop(int source)

Calls alSourceStop.

void pause(int source)

Calls alSourcePause.

void gain(int source, float gain)

Calls alSourcef with AL_GAIN.

void queueBuffer(int source, int buffer)

Calls alSourceQueueBuffers.

int unqueueBuffer(int source)

Calls alSourceUnqueueBuffers.

void destroyContext()

Releases the current context when it is its own, destroys it and closes the device; does nothing when it created none.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page