Skip to content

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.

Create it with the binding of your library (Create the bridge).

ReturnsSignatureSummary
AlAudioBridgecreate(IAlBinding binding) factoryCreates the bridge over the OpenAL binding of your library.

PropertyTypeDefaultSummary
gainAudioGain(gain, group) -> gainThe function that maps the gain and the audio group of a source to the volume sent to OpenAL; setting it updates every live source.
ownContextbooleantrueIf 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.

ReturnsSignatureSummary
thisgroupVolume(Object group, float volume) fluentSets the volume of every source of that audio group, 1F for 100 %, and updates the live sources.
IAudioSourcecreateSource(int sampleRate, int channels)Creates a streaming source, after creating the OpenAL context when the bridge owns it and none is current.
voidreleaseSource(AlAudioSource source)Forgets the source; AlAudioSource.delete calls it.
floatgetGroupVolume(Object group)Returns the volume of the audio group, 1F when none was set.
IAlBindinggetBinding()Returns the OpenAL binding of the bridge.

AlAudioBridge create(IAlBinding binding) factory

Creates the bridge over the OpenAL binding of your library.

  • this gain(AudioGain gain) fluent
  • AudioGain 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.

  • this ownContext(boolean ownContext) fluent
  • boolean 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.

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.


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