JOAL v2.6.0-rc-20250706
JOAL, OpenAL® API Binding for Java™ (public API).
com.jogamp.openal.util.ALHelpers Class Reference
Collaboration diagram for com.jogamp.openal.util.ALHelpers:

Static Public Member Functions

static AudioFormat getAudioFormat (final int alChannelLayout, final int alSampleType, final int alFormat, final int sampleRate, final int sampleSize)
 Returns a compatible AudioFormat based on given OpenAL channel-layout, sample-type and format, as well as the generic sample-rate and sample-size. More...
 
static int getALFormat (final AudioFormat audioFormat, final AL al, final ALExt alExt)
 Returns a compatible AL buffer format given the AudioFormat, which determines the AL channel layout and AL sample type. More...
 
static int getALFormat (final AudioFormat audioFormat, final AL al, final ALExt alExt, final boolean hasSOFTBufferSamples, final boolean hasEXTMcFormats, final boolean hasEXTFloat32, final boolean hasEXTDouble)
 Returns a compatible AL buffer format given the AudioFormat, which determines the AL channel layout and AL sample type. More...
 
static final int getALFormat (final int alChannelLayout, final int alSampleType, final AL al, final ALExt alExt)
 Returns a compatible AL buffer format given the AL channel layout and AL sample type. More...
 
static final int getALFormat (final int alChannelLayout, final int alSampleType, final AL al, final ALExt alExt, final boolean hasSOFTBufferSamples, final boolean hasEXTMcFormats, final boolean hasEXTFloat32, final boolean hasEXTDouble)
 Returns a compatible AL buffer format given the AL channel layout and AL sample type. More...
 
static final int getDefaultALChannelLayout (final int channelCount)
 Returns the default AL channel layout matching the given channel count, or ALConstants#AL_NONE. More...
 
static final String alChannelLayoutName (final int alChannelLayout)
 Returns the readable name of the given AL channel layout. More...
 
static final int getALChannelLayoutChannelCount (final int alChannelLayout)
 Returns the channel count of the given AL channel layout. More...
 
static final int getALSampleType (final int sampleSize, final boolean signed, final boolean fixedP)
 Returns the AL sample type matching the given audio type attributes, or ALConstants#AL_NONE. More...
 
static final String alSampleTypeName (final int alSampleType)
 Returns the readable name of the given AL sample type. More...
 
static final boolean isALSampleTypeSigned (final int alSampleType)
 Returns whether the given AL sample type is signed. More...
 
static final boolean isALSampleTypeFixed (final int alSampleType)
 Returns true if the given AL sample type is a fixed point (byte, short, int, ..) or false if a floating point type (float, double). More...
 
static final int sizeOfALSampleType (final int alSampleType) throws IllegalArgumentException
 Returns the byte size of the given AL sample type. More...
 
static final int samplesToByteCount (int sampleCount, final int alChannelLayout, final int alSampleType) throws IllegalArgumentException
 
static final int bytesToSampleCount (final int byteCount, final int alChannelLayout, final int alSampleType)
 
static final String alSourceStateString (final int sourceState)
 Returns given ALConstants#AL_SOURCE_STATE AL#alGetSourcei(int, int, int[], int)} value as a string. More...
 

Static Public Attributes

static final String AL_SOFT_buffer_samples = "AL_SOFT_buffer_samples"
 openal-soft >= 1.18.0 More...
 
static final String AL_SOFT_events = "AL_SOFT_events"
 
static final String AL_EXT_MCFORMATS = "AL_EXT_MCFORMATS"
 
static final String AL_EXT_FLOAT32 = "AL_EXT_FLOAT32"
 
static final String AL_EXT_DOUBLE = "AL_EXT_DOUBLE"
 
static final String ALC_EXT_thread_local_context = "ALC_EXT_thread_local_context"
 
static final String ALC_ENUMERATION_EXT = "ALC_ENUMERATION_EXT"
 
static final String ALC_ENUMERATE_ALL_EXT = "ALC_ENUMERATE_ALL_EXT"
 
static final String ALC_EXT_debug = "ALC_EXT_debug"
 
static final String AL_EXT_debug = "AL_EXT_debug"
 
static final String ALC_SOFT_system_events = "ALC_SOFT_system_events"
 

Detailed Description

Definition at line 39 of file ALHelpers.java.

Member Function Documentation

◆ alChannelLayoutName()

static final String com.jogamp.openal.util.ALHelpers.alChannelLayoutName ( final int  alChannelLayout)
static

Returns the readable name of the given AL channel layout.

Definition at line 411 of file ALHelpers.java.

Here is the caller graph for this function:

◆ alSampleTypeName()

static final String com.jogamp.openal.util.ALHelpers.alSampleTypeName ( final int  alSampleType)
static

Returns the readable name of the given AL sample type.

Definition at line 475 of file ALHelpers.java.

Here is the caller graph for this function:

◆ alSourceStateString()

static final String com.jogamp.openal.util.ALHelpers.alSourceStateString ( final int  sourceState)
static

Returns given ALConstants#AL_SOURCE_STATE AL#alGetSourcei(int, int, int[], int)} value as a string.

Definition at line 600 of file ALHelpers.java.

Here is the caller graph for this function:

◆ bytesToSampleCount()

static final int com.jogamp.openal.util.ALHelpers.bytesToSampleCount ( final int  byteCount,
final int  alChannelLayout,
final int  alSampleType 
)
static

Definition at line 595 of file ALHelpers.java.

Here is the call graph for this function:

◆ getALChannelLayoutChannelCount()

static final int com.jogamp.openal.util.ALHelpers.getALChannelLayoutChannelCount ( final int  alChannelLayout)
static

Returns the channel count of the given AL channel layout.

Definition at line 427 of file ALHelpers.java.

Here is the caller graph for this function:

◆ getALFormat() [1/4]

static int com.jogamp.openal.util.ALHelpers.getALFormat ( final AudioFormat  audioFormat,
final AL  al,
final ALExt  alExt 
)
static

Returns a compatible AL buffer format given the AudioFormat, which determines the AL channel layout and AL sample type.

If hasEXTMcFormats or hasSOFTBufferSamples is true, it will be called to find the closest-matching format from AL_EXT_MCFORMATS or AL_SOFT_buffer_samples.

Returns ALConstants#AL_NONE if no supported format can be found.

Function uses AL#alIsExtensionPresent(String), which might be context dependent, otherwise function is context independent.

Parameters
audioFormatused to derive AL channel layout getDefaultALChannelLayout(int) and AL sample type getALSampleType(int, boolean, boolean)
alAL instance
alExtALExt instance
Returns
AL buffer format

Definition at line 114 of file ALHelpers.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getALFormat() [2/4]

static int com.jogamp.openal.util.ALHelpers.getALFormat ( final AudioFormat  audioFormat,
final AL  al,
final ALExt  alExt,
final boolean  hasSOFTBufferSamples,
final boolean  hasEXTMcFormats,
final boolean  hasEXTFloat32,
final boolean  hasEXTDouble 
)
static

Returns a compatible AL buffer format given the AudioFormat, which determines the AL channel layout and AL sample type.

If hasEXTMcFormats or hasSOFTBufferSamples is true, it will be called to find the closest-matching format from AL_EXT_MCFORMATS or AL_SOFT_buffer_samples.

Returns ALConstants#AL_NONE if no supported format can be found.

Function is context independent.

Parameters
audioFormatused to derive AL channel layout getDefaultALChannelLayout(int) and AL sample type getALSampleType(int, boolean, boolean)
alAL instance
alExtALExt instance
hasSOFTBufferSamplestrue if having extension AL_SOFT_buffer_samples, otherwise false
hasEXTMcFormatstrue if having extension AL_EXT_MCFORMATS, otherwise false
hasEXTFloat32true if having extension AL_EXT_FLOAT32, otherwise false
hasEXTDoubletrue if having extension AL_EXT_DOUBLE, otherwise false
Returns
AL buffer format

Definition at line 151 of file ALHelpers.java.

Here is the call graph for this function:

◆ getALFormat() [3/4]

static final int com.jogamp.openal.util.ALHelpers.getALFormat ( final int  alChannelLayout,
final int  alSampleType,
final AL  al,
final ALExt  alExt 
)
static

Returns a compatible AL buffer format given the AL channel layout and AL sample type.

If hasEXTMcFormats or hasSOFTBufferSamples is true, it will be called to find the closest-matching format from AL_EXT_MCFORMATS or AL_SOFT_buffer_samples.

Returns ALConstants#AL_NONE if no supported format can be found.

Function uses AL#alIsExtensionPresent(String), which might be context dependent, otherwise function is context independent.

Parameters
alChannelLayoutAL channel layout, see getDefaultALChannelLayout(int)
alSampleTypeAL sample type, see getALSampleType(int, boolean, boolean).
alAL instance
alExtALExt instance
Returns
AL buffer format

Definition at line 190 of file ALHelpers.java.

Here is the call graph for this function:

◆ getALFormat() [4/4]

static final int com.jogamp.openal.util.ALHelpers.getALFormat ( final int  alChannelLayout,
final int  alSampleType,
final AL  al,
final ALExt  alExt,
final boolean  hasSOFTBufferSamples,
final boolean  hasEXTMcFormats,
final boolean  hasEXTFloat32,
final boolean  hasEXTDouble 
)
static

Returns a compatible AL buffer format given the AL channel layout and AL sample type.

If hasEXTMcFormats or hasSOFTBufferSamples is true, it will be called to find the closest-matching format from AL_EXT_MCFORMATS or AL_SOFT_buffer_samples.

Returns ALConstants#AL_NONE if no supported format can be found.

Function is context independent.

Parameters
alChannelLayoutAL channel layout, see getDefaultALChannelLayout(int)
alSampleTypeAL sample type, see getALSampleType(int, boolean, boolean).
alAL instance
alExtALExt instance
hasSOFTBufferSamplestrue if having extension AL_SOFT_buffer_samples, otherwise false
hasEXTMcFormatstrue if having extension AL_EXT_MCFORMATS, otherwise false
hasEXTFloat32true if having extension AL_EXT_FLOAT32, otherwise false
hasEXTDoubletrue if having extension AL_EXT_DOUBLE, otherwise false
Returns
AL buffer format

Definition at line 225 of file ALHelpers.java.

Here is the call graph for this function:

◆ getALSampleType()

static final int com.jogamp.openal.util.ALHelpers.getALSampleType ( final int  sampleSize,
final boolean signed  ,
final boolean  fixedP 
)
static

Returns the AL sample type matching the given audio type attributes, or ALConstants#AL_NONE.

Parameters
sampleSizesample size in bits
signedtrue if signed number, false for unsigned
fixedPtrue for fixed point value, false for floating point value with a sampleSize of 32 (float) or 64 (double)

Definition at line 446 of file ALHelpers.java.

Here is the caller graph for this function:

◆ getAudioFormat()

static AudioFormat com.jogamp.openal.util.ALHelpers.getAudioFormat ( final int  alChannelLayout,
final int  alSampleType,
final int  alFormat,
final int  sampleRate,
final int  sampleSize 
)
static

Returns a compatible AudioFormat based on given OpenAL channel-layout, sample-type and format, as well as the generic sample-rate and sample-size.

The resulting AudioFormat uses AudioFormat#planar = false and AudioFormat#littleEndian = true.

Parameters
alChannelLayoutOpenAL channel layout
alSampleTypeOpenAL sample type
alFormatOpenAL format
sampleRatesample rate, e.g. 44100
sampleSizesample size in bits, e.g. 16
Returns
a new AudioFormat instance or null if parameter are not conclusive or invalid.

Definition at line 75 of file ALHelpers.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultALChannelLayout()

static final int com.jogamp.openal.util.ALHelpers.getDefaultALChannelLayout ( final int  channelCount)
static

Returns the default AL channel layout matching the given channel count, or ALConstants#AL_NONE.

Parameters
channelCountnumber of channels
signedtrue if signed number, false for unsigned
fixedPtrue for fixed point value, false for floating point value with a sampleSize of 32 (float) or 64 (double)

Definition at line 395 of file ALHelpers.java.

Here is the caller graph for this function:

◆ isALSampleTypeFixed()

static final boolean com.jogamp.openal.util.ALHelpers.isALSampleTypeFixed ( final int  alSampleType)
static

Returns true if the given AL sample type is a fixed point (byte, short, int, ..) or false if a floating point type (float, double).

Definition at line 512 of file ALHelpers.java.

Here is the caller graph for this function:

◆ isALSampleTypeSigned()

static final boolean com.jogamp.openal.util.ALHelpers.isALSampleTypeSigned ( final int  alSampleType)
static

Returns whether the given AL sample type is signed.

Definition at line 492 of file ALHelpers.java.

Here is the caller graph for this function:

◆ samplesToByteCount()

static final int com.jogamp.openal.util.ALHelpers.samplesToByteCount ( int  sampleCount,
final int  alChannelLayout,
final int  alSampleType 
) throws IllegalArgumentException
static
Parameters
sampleCountnumber of samples per channel
alChannelLayoutAL channel layout
alSampleTypeAL sample type
Returns
bytes count required
Exceptions
IllegalArgumentExceptionfor unknown alChannelLayout or alSampleType values.

Definition at line 558 of file ALHelpers.java.

Here is the caller graph for this function:

◆ sizeOfALSampleType()

static final int com.jogamp.openal.util.ALHelpers.sizeOfALSampleType ( final int  alSampleType) throws IllegalArgumentException
static

Returns the byte size of the given AL sample type.

Exceptions
IllegalArgumentExceptionfor unknown alChannelLayout or alSampleType values.

Definition at line 532 of file ALHelpers.java.

Member Data Documentation

◆ AL_EXT_debug

final String com.jogamp.openal.util.ALHelpers.AL_EXT_debug = "AL_EXT_debug"
static

Definition at line 59 of file ALHelpers.java.

◆ AL_EXT_DOUBLE

final String com.jogamp.openal.util.ALHelpers.AL_EXT_DOUBLE = "AL_EXT_DOUBLE"
static

Definition at line 51 of file ALHelpers.java.

◆ AL_EXT_FLOAT32

final String com.jogamp.openal.util.ALHelpers.AL_EXT_FLOAT32 = "AL_EXT_FLOAT32"
static

Definition at line 50 of file ALHelpers.java.

◆ AL_EXT_MCFORMATS

final String com.jogamp.openal.util.ALHelpers.AL_EXT_MCFORMATS = "AL_EXT_MCFORMATS"
static

Definition at line 49 of file ALHelpers.java.

◆ AL_SOFT_buffer_samples

final String com.jogamp.openal.util.ALHelpers.AL_SOFT_buffer_samples = "AL_SOFT_buffer_samples"
static

openal-soft >= 1.18.0

  • Removed support for the AL_SOFT_buffer_samples and AL_SOFT_buffer_sub_data extensions. Due to conflicts with AL_EXT_SOURCE_RADIUS.

Definition at line 45 of file ALHelpers.java.

◆ AL_SOFT_events

final String com.jogamp.openal.util.ALHelpers.AL_SOFT_events = "AL_SOFT_events"
static

Definition at line 47 of file ALHelpers.java.

◆ ALC_ENUMERATE_ALL_EXT

final String com.jogamp.openal.util.ALHelpers.ALC_ENUMERATE_ALL_EXT = "ALC_ENUMERATE_ALL_EXT"
static

Definition at line 56 of file ALHelpers.java.

◆ ALC_ENUMERATION_EXT

final String com.jogamp.openal.util.ALHelpers.ALC_ENUMERATION_EXT = "ALC_ENUMERATION_EXT"
static

Definition at line 55 of file ALHelpers.java.

◆ ALC_EXT_debug

final String com.jogamp.openal.util.ALHelpers.ALC_EXT_debug = "ALC_EXT_debug"
static

Definition at line 58 of file ALHelpers.java.

◆ ALC_EXT_thread_local_context

final String com.jogamp.openal.util.ALHelpers.ALC_EXT_thread_local_context = "ALC_EXT_thread_local_context"
static

Definition at line 53 of file ALHelpers.java.

◆ ALC_SOFT_system_events

final String com.jogamp.openal.util.ALHelpers.ALC_SOFT_system_events = "ALC_SOFT_system_events"
static

Definition at line 60 of file ALHelpers.java.


The documentation for this class was generated from the following file: