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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
Lwjgl3AlBinding | inst() factory | Returns the only instance. |
Methods
Section titled “Methods”Queries
Section titled “Queries”| Returns | Signature | Summary |
|---|---|---|
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. |
Actions
Section titled “Actions”| Returns | Signature | Summary |
|---|---|---|
void | createContext() | Opens the default device with alcOpenDevice, creates a context on it and makes it current. |
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. |
Creation details
Section titled “Creation details”Lwjgl3AlBinding inst() factory
Returns the only instance.
Method details
Section titled “Method details”getCurrentContext
Section titled “getCurrentContext”Object getCurrentContext()
Returns the OpenAL capabilities of the current context, or null when no context is current.
isPlaying
Section titled “isPlaying”boolean isPlaying(int source)
Calls alGetSourcei with AL_SOURCE_STATE.
getQueuedBuffers
Section titled “getQueuedBuffers”int getQueuedBuffers(int source)
Calls alGetSourcei with AL_BUFFERS_QUEUED.
getProcessedBuffers
Section titled “getProcessedBuffers”int getProcessedBuffers(int source)
Calls alGetSourcei with AL_BUFFERS_PROCESSED.
createContext
Section titled “createContext”void createContext()
Throws:
IllegalStateException: OpenAL cannot open the default audio device, check that an audio output device is connected and enabledIllegalStateException: 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.
genSource
Section titled “genSource”int genSource()
Calls alGenSources, then places the source at the listener with AL_SOURCE_RELATIVE and a position of zero.
deleteSource
Section titled “deleteSource”void deleteSource(int source)
Calls alDeleteSources.
genBuffer
Section titled “genBuffer”int genBuffer()
Calls alGenBuffers.
deleteBuffer
Section titled “deleteBuffer”void deleteBuffer(int buffer)
Calls alDeleteBuffers.
bufferData
Section titled “bufferData”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.
queueBuffer
Section titled “queueBuffer”void queueBuffer(int source, int buffer)
Calls alSourceQueueBuffers.
unqueueBuffer
Section titled “unqueueBuffer”int unqueueBuffer(int source)
Calls alSourceUnqueueBuffers.
destroyContext
Section titled “destroyContext”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
