Top Constructors Methods
com.jogamp.openal.util

public Class ALHelpers

extends Object
Class Inheritance
Imports
com.jogamp.openal.AL, .ALConstants, .ALExt

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final String
alChannelLayoutName(final int alChannelLayout)

Returns the readable name of the given AL channel layout

public static final String
alSampleTypeName(final int alSampleType)

Returns the readable name of the given AL sample type

public static final int
bytesToSampleCount(final int byteCount, final int alChannelLayout, final int alSampleType)

public static final int

Returns:

AL buffer format
getALFormat
(final int
AL channel layout, see getDefaultALChannelLayout(int)
alChannelLayout
,
final int alSampleType, final boolean
true if having extension AL_SOFT_buffer_samples, otherwise false
hasSOFTBufferSamples
,
final AL
AL instance
al
,
final ALExt
ALExt instance
alExt
)

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

public static final int
getALSampleType(final int
sample size in bits
sampleSize
,
final boolean
true if signed number, false for unsigned
signed
,
final boolean
true for fixed point value, false for floating point value with a sampleSize of 32 (float) or 64 (double)
fixedP
)

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

public static final int
getDefaultALChannelLayout(final int
number of channels
channelCount
)

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

public static final int

Returns:

bytes count required
samplesToByteCount
(int
number of samples per channel
sampleCount
,
final int
AL channel layout
alChannelLayout
,
final int
AL sample type
alSampleType
)

public static final int
sizeOfALSampleType(final int alSampleType)

Returns the byte size of the given AL sample type

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ALHelpersback to summary
public ALHelpers()

Method Detail

alChannelLayoutNameback to summary
public static final String alChannelLayoutName(final int alChannelLayout)

Returns the readable name of the given AL channel layout

alSampleTypeNameback to summary
public static final String alSampleTypeName(final int alSampleType)

Returns the readable name of the given AL sample type

bytesToSampleCountback to summary
public static final int bytesToSampleCount(final int byteCount, final int alChannelLayout, final int alSampleType)
getALFormatback to summary
public static final int getALFormat(final int alChannelLayout, final int alSampleType, final boolean hasSOFTBufferSamples, final AL al, final ALExt alExt)

Returns a compatible AL buffer format given the AL channel layout and AL sample type. If hasSOFTBufferSamples is true, it will be called to find the closest-matching format from AL_SOFT_buffer_samples.

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

Parameters
alChannelLayout:int

AL channel layout, see getDefaultALChannelLayout(int)

alSampleType:int

AL sample type, see getALSampleType(int, boolean, boolean).

hasSOFTBufferSamples:boolean

true if having extension AL_SOFT_buffer_samples, otherwise false

al:AL

AL instance

alExt:ALExt

ALExt instance

Returns:int

AL buffer format

getALSampleTypeback to summary
public 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.

Parameters
sampleSize:int

sample size in bits

signed:boolean

true if signed number, false for unsigned

fixedP:boolean

true for fixed point value, false for floating point value with a sampleSize of 32 (float) or 64 (double)

getDefaultALChannelLayoutback to summary
public static final int getDefaultALChannelLayout(final int channelCount)

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

Parameters
channelCount:int

number of channels

samplesToByteCountback to summary
public static final int samplesToByteCount(int sampleCount, final int alChannelLayout, final int alSampleType) throws IllegalArgumentException
Parameters
sampleCount:int

number of samples per channel

alChannelLayout:int

AL channel layout

alSampleType:int

AL sample type

Returns:int

bytes count required

Exceptions
IllegalArgumentException:
for unknown alChannelLayout or alSampleType values.
sizeOfALSampleTypeback to summary
public static final int sizeOfALSampleType(final int alSampleType) throws IllegalArgumentException

Returns the byte size of the given AL sample type

Exceptions
IllegalArgumentException:
for unknown alChannelLayout or alSampleType values.