Skip to content

IAlBinding

interface IAlBinding
Known subtypes: Lwjgl2AlBinding, Lwjgl3AlBinding
Package: dev.joid.base.openal.binding · Module: base-openal · Source: IAlBinding.java

The OpenAL calls that AlAudioBridge needs, implemented once per LWJGL version.

A backend gives a binding to AlAudioBridge.create, so that base-openal depends on no LWJGL version. Every method runs on the render thread.

ReturnsSignatureSummary
voidcreateContext() abstractOpens the default audio device and makes an OpenAL context current on it; throws an IllegalStateException when the device or the context cannot be created.
voiddestroyContext() abstractDestroys the context that createContext() created and closes its device; does nothing when there is none.
ObjectgetCurrentContext() abstractReturns an object that identifies the current OpenAL context, or null when none is current.
intgenSource() abstractCreates a source placed at the listener, so that no position attenuates or pans it, and returns its name.
voiddeleteSource(int source) abstractDeletes the source.
intgenBuffer() abstractCreates a buffer and returns its name.
voiddeleteBuffer(int buffer) abstractDeletes the buffer.
voidbufferData(int buffer, int channels, short[] samples, int sampleRate) abstractFills the buffer with interleaved 16-bit samples, mono for one channel and stereo for two, at that sample rate in hertz.
voidplay(int source) abstractPlays the source.
voidstop(int source) abstractStops the source; its queued buffers become processed.
voidpause(int source) abstractPauses the source.
voidgain(int source, float gain) abstractSets the gain of the source, 1F for 100 %.
voidqueueBuffer(int source, int buffer) abstractAppends the buffer to the queue of the source.
intunqueueBuffer(int source) abstractRemoves the oldest buffer from the queue of the source and returns its name.
booleanisPlaying(int source) abstractIf true, the source is in the playing state.
intgetQueuedBuffers(int source) abstractReturns the number of buffers in the queue of the source, played or not.
intgetProcessedBuffers(int source) abstractReturns the number of queued buffers that the source has finished playing.

void createContext() abstract

Opens the default audio device and makes an OpenAL context current on it; throws an IllegalStateException when the device or the context cannot be created.

void destroyContext() abstract

Destroys the context that createContext() created and closes its device; does nothing when there is none.

Object getCurrentContext() abstract

Returns an object that identifies the current OpenAL context, or null when none is current. A source compares it between calls to notice a context that the host replaced.

int genSource() abstract

Creates a source placed at the listener, so that no position attenuates or pans it, and returns its name.

void deleteSource(int source) abstract

Deletes the source.

int genBuffer() abstract

Creates a buffer and returns its name.

void deleteBuffer(int buffer) abstract

Deletes the buffer.

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

Fills the buffer with interleaved 16-bit samples, mono for one channel and stereo for two, at that sample rate in hertz.

void play(int source) abstract

Plays the source.

void stop(int source) abstract

Stops the source; its queued buffers become processed.

void pause(int source) abstract

Pauses the source.

void gain(int source, float gain) abstract

Sets the gain of the source, 1F for 100 %.

void queueBuffer(int source, int buffer) abstract

Appends the buffer to the queue of the source.

int unqueueBuffer(int source) abstract

Removes the oldest buffer from the queue of the source and returns its name.

boolean isPlaying(int source) abstract

If true, the source is in the playing state.

int getQueuedBuffers(int source) abstract

Returns the number of buffers in the queue of the source, played or not.

int getProcessedBuffers(int source) abstract

Returns the number of queued buffers that the source has finished playing.


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