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.
Description
Section titled “Description”A backend gives a binding to AlAudioBridge.create, so that base-openal depends on no LWJGL version.
Every method runs on the render thread.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
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. |
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. |
Method details
Section titled “Method details”createContext
Section titled “createContext”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.
destroyContext
Section titled “destroyContext”void destroyContext() abstract
Destroys the context that createContext() created and closes its device; does nothing when there is none.
getCurrentContext
Section titled “getCurrentContext”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.
genSource
Section titled “genSource”int genSource() abstract
Creates a source placed at the listener, so that no position attenuates or pans it, and returns its name.
deleteSource
Section titled “deleteSource”void deleteSource(int source) abstract
Deletes the source.
genBuffer
Section titled “genBuffer”int genBuffer() abstract
Creates a buffer and returns its name.
deleteBuffer
Section titled “deleteBuffer”void deleteBuffer(int buffer) abstract
Deletes the buffer.
bufferData
Section titled “bufferData”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 %.
queueBuffer
Section titled “queueBuffer”void queueBuffer(int source, int buffer) abstract
Appends the buffer to the queue of the source.
unqueueBuffer
Section titled “unqueueBuffer”int unqueueBuffer(int source) abstract
Removes the oldest buffer from the queue of the source and returns its name.
isPlaying
Section titled “isPlaying”boolean isPlaying(int source) abstract
If true, the source is in the playing state.
getQueuedBuffers
Section titled “getQueuedBuffers”int getQueuedBuffers(int source) abstract
Returns the number of buffers in the queue of the source, played or not.
getProcessedBuffers
Section titled “getProcessedBuffers”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
