AlAudioBridge
final class AlAudioBridge
Implements: IAudioBridge
Package: dev.joid.base.openal · Module: base-openal · Source: AlAudioBridge.java
The audio bridge of OpenAL, whose streaming sources call OpenAL through a binding.
Description
Section titled “Description”Create it with the binding of your library (Create the bridge).
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
AlAudioBridge | create(IAlBinding binding) factory | Creates the bridge over the OpenAL binding of your library. |
Properties
Section titled “Properties”| Property | Type | Default | Summary |
|---|---|---|---|
| gain | AudioGain | (gain, group) -> gain | The function that maps the gain and the audio group of a source to the volume sent to OpenAL; setting it updates every live source. |
| ownContext | boolean | true | If true, the bridge creates an OpenAL context on the default device when the first source needs one and destroys it when the JVM exits; if false, the host owns the context. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
this | groupVolume(Object group, float volume) fluent | Sets the volume of every source of that audio group, 1F for 100 %, and updates the live sources. |
IAudioSource | createSource(int sampleRate, int channels) | Creates a streaming source, after creating the OpenAL context when the bridge owns it and none is current. |
void | releaseSource(AlAudioSource source) | Forgets the source; AlAudioSource.delete calls it. |
float | getGroupVolume(Object group) | Returns the volume of the audio group, 1F when none was set. |
IAlBinding | getBinding() | Returns the OpenAL binding of the bridge. |
Creation details
Section titled “Creation details”create
Section titled “create”AlAudioBridge create(IAlBinding binding) factory
Creates the bridge over the OpenAL binding of your library.
Property details
Section titled “Property details”this gain(AudioGain gain)fluentAudioGain getGain()
Default: (gain, group) -> gain
The function that maps the gain and the audio group of a source to the volume sent to OpenAL; setting it updates every live source.
ownContext
Section titled “ownContext”this ownContext(boolean ownContext)fluentboolean isOwnContext()
Default: true
If true, the bridge creates an OpenAL context on the default device when the first source needs one and destroys it when the JVM exits; if false, the host owns the context.
Method details
Section titled “Method details”groupVolume
Section titled “groupVolume”this groupVolume(Object group, float volume) fluent
Sets the volume of every source of that audio group, 1F for 100 %, and updates the live sources.
createSource
Section titled “createSource”IAudioSource createSource(int sampleRate, int channels)
Creates a streaming source, after creating the OpenAL context when the bridge owns it and none is current.
releaseSource
Section titled “releaseSource”void releaseSource(AlAudioSource source)
Forgets the source; AlAudioSource.delete calls it.
getGroupVolume
Section titled “getGroupVolume”float getGroupVolume(Object group)
Returns the volume of the audio group, 1F when none was set.
getBinding
Section titled “getBinding”IAlBinding getBinding()
Returns the OpenAL binding of the bridge.
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
