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

Classes

class  ALAudioFrame
 

Public Member Functions

 ALAudioSink () throws ALException
 Create a new instance with a new default ALCdevice. More...
 
 ALAudioSink (final String deviceName) throws ALException
 Create a new instance with a new named ALCdevice. More...
 
 ALAudioSink (final Device alDevice) throws ALException
 Create a new instance with an optional given ALCdevice. More...
 
final Device getDevice ()
 Return this instance's OpenAL Device. More...
 
final Context getContext ()
 Return this instance's OpenAL Context. More...
 
final Source getSource ()
 Return this instance's OpenAL Source. More...
 
final boolean hasSOFTBufferSamples ()
 Return whether OpenAL extension AL_SOFT_buffer_samples is available. More...
 
final boolean hasEXTMcFormats ()
 Return whether OpenAL extension AL_EXT_MCFORMATS is available. More...
 
final boolean hasEXTFloat32 ()
 Return whether OpenAL extension AL_EXT_FLOAT32 is available. More...
 
final boolean hasEXTDouble ()
 Return whether OpenAL extension AL_EXT_DOUBLE is available. More...
 
final boolean hasALCThreadLocalContext ()
 Return whether OpenAL extension ALC_EXT_thread_local_context is available. More...
 
final boolean hasSOFTEvents ()
 Return whether OpenAL extension AL_SOFT_events is available. More...
 
final void setUseSOFTEvents (final boolean v)
 Enable or disable AL_SOFT_events, default is enabled if hasSOFTEvents(). More...
 
final boolean getUseSOFTEvents (final boolean v)
 Returns whether AL_SOFT_events is enabled, default if hasSOFTEvents(). More...
 
final int getALChannelLayout ()
 Return this instance's OpenAL channel layout, set after init(AudioFormat, float, int). More...
 
final int getALSampleType ()
 Return this instance's OpenAL sample type, set after init(AudioFormat, float, int). More...
 
final int getALFormat ()
 Return this instance's OpenAL format, set after init(AudioFormat, float, int). More...
 
final boolean makeCurrent (final boolean throwException)
 
final boolean release (final boolean throwException)
 
final String toString ()
 
final String getPerfString ()
 
int getSourceCount ()
 
float getDefaultLatency ()
 
float getLatency ()
 
final AudioFormat getNativeFormat ()
 
final AudioFormat getPreferredFormat ()
 
final void setChannelLimit (final int cc)
 
final boolean isSupported (final AudioFormat format)
 
final boolean init (final AudioFormat requestedFormat, final int frameDurationHint, final int queueSize)
 
final boolean init (final int alChannelLayout, final int alSampleType, final int alFormat, final int sampleRate, final int sampleSize, final int frameDurationHint, final int queueSize)
 Initializes the sink using the given OpenAL audio parameter and streaming details. More...
 
final AudioFormat getChosenFormat ()
 
final void destroy ()
 
final boolean isAvailable ()
 
final PTS updateQueue ()
 
final AudioFrame enqueueData (final int pts, final ByteBuffer bytes, final int byteCount)
 
final boolean isPlaying ()
 
final void play ()
 
final void pause ()
 
final float getPlaySpeed ()
 
final boolean setPlaySpeed (float rate)
 
final float getVolume ()
 
final boolean setVolume (float v)
 
final void flush ()
 
final int getEnqueuedFrameCount ()
 
final int getFrameCount ()
 
final int getQueuedFrameCount ()
 
final int getFreeFrameCount ()
 
final int getQueuedByteCount ()
 
final float getQueuedDuration ()
 
float getAvgFrameDuration ()
 
final PTS getPTS ()
 
final int getLastBufferedPTS ()
 

Static Public Member Functions

static boolean isInitialized ()
 Returns true if OpenAL has been loaded and static fields ALC, AL and ALExt have been initialized successfully, otherwise false. More...
 
static final AL getAL ()
 Return OpenAL global AL. More...
 
static final ALC getALC ()
 Return OpenAL global ALC. More...
 
static final ALExt getALExt ()
 Return OpenAL global ALExt. More...
 

Detailed Description

Definition at line 71 of file ALAudioSink.java.

Constructor & Destructor Documentation

◆ ALAudioSink() [1/3]

com.jogamp.openal.util.ALAudioSink.ALAudioSink ( ) throws ALException

Create a new instance with a new default ALCdevice.

Exceptions
ALExceptionif the default ALCdevice couldn't be fully created including its context.

Definition at line 174 of file ALAudioSink.java.

◆ ALAudioSink() [2/3]

com.jogamp.openal.util.ALAudioSink.ALAudioSink ( final String  deviceName) throws ALException

Create a new instance with a new named ALCdevice.

Parameters
deviceNamename of
Exceptions
ALExceptionif the default ALCdevice couldn't be fully created including its context.

Definition at line 183 of file ALAudioSink.java.

◆ ALAudioSink() [3/3]

com.jogamp.openal.util.ALAudioSink.ALAudioSink ( final Device  alDevice) throws ALException

Create a new instance with an optional given ALCdevice.

Parameters
alDeviceoptional OpenAL Device, a default device is opened if null.
Exceptions
ALExceptionif the default ALCdevice couldn't be fully created including its context.

Definition at line 193 of file ALAudioSink.java.

Here is the call graph for this function:

Member Function Documentation

◆ destroy()

final void com.jogamp.openal.util.ALAudioSink.destroy ( )

Definition at line 689 of file ALAudioSink.java.

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

◆ enqueueData()

final AudioFrame com.jogamp.openal.util.ALAudioSink.enqueueData ( final int  pts,
final ByteBuffer  bytes,
final int  byteCount 
)

Definition at line 937 of file ALAudioSink.java.

Here is the call graph for this function:

◆ flush()

final void com.jogamp.openal.util.ALAudioSink.flush ( )

Definition at line 1209 of file ALAudioSink.java.

Here is the call graph for this function:

◆ getAL()

static final AL com.jogamp.openal.util.ALAudioSink.getAL ( )
static

Return OpenAL global AL.

Definition at line 313 of file ALAudioSink.java.

◆ getALC()

static final ALC com.jogamp.openal.util.ALAudioSink.getALC ( )
static

Return OpenAL global ALC.

Definition at line 315 of file ALAudioSink.java.

◆ getALChannelLayout()

final int com.jogamp.openal.util.ALAudioSink.getALChannelLayout ( )

Return this instance's OpenAL channel layout, set after init(AudioFormat, float, int).

Definition at line 344 of file ALAudioSink.java.

◆ getALExt()

static final ALExt com.jogamp.openal.util.ALAudioSink.getALExt ( )
static

Return OpenAL global ALExt.

Definition at line 317 of file ALAudioSink.java.

◆ getALFormat()

final int com.jogamp.openal.util.ALAudioSink.getALFormat ( )

Return this instance's OpenAL format, set after init(AudioFormat, float, int).

Definition at line 348 of file ALAudioSink.java.

◆ getALSampleType()

final int com.jogamp.openal.util.ALAudioSink.getALSampleType ( )

Return this instance's OpenAL sample type, set after init(AudioFormat, float, int).

Definition at line 346 of file ALAudioSink.java.

◆ getAvgFrameDuration()

float com.jogamp.openal.util.ALAudioSink.getAvgFrameDuration ( )

Definition at line 1273 of file ALAudioSink.java.

◆ getChosenFormat()

final AudioFormat com.jogamp.openal.util.ALAudioSink.getChosenFormat ( )

Definition at line 648 of file ALAudioSink.java.

◆ getContext()

final Context com.jogamp.openal.util.ALAudioSink.getContext ( )

Return this instance's OpenAL Context.

Definition at line 322 of file ALAudioSink.java.

Here is the caller graph for this function:

◆ getDefaultLatency()

float com.jogamp.openal.util.ALAudioSink.getDefaultLatency ( )

Definition at line 395 of file ALAudioSink.java.

◆ getDevice()

final Device com.jogamp.openal.util.ALAudioSink.getDevice ( )

Return this instance's OpenAL Device.

Definition at line 320 of file ALAudioSink.java.

Here is the caller graph for this function:

◆ getEnqueuedFrameCount()

final int com.jogamp.openal.util.ALAudioSink.getEnqueuedFrameCount ( )

Definition at line 1231 of file ALAudioSink.java.

◆ getFrameCount()

final int com.jogamp.openal.util.ALAudioSink.getFrameCount ( )

Definition at line 1236 of file ALAudioSink.java.

◆ getFreeFrameCount()

final int com.jogamp.openal.util.ALAudioSink.getFreeFrameCount ( )

Definition at line 1249 of file ALAudioSink.java.

◆ getLastBufferedPTS()

final int com.jogamp.openal.util.ALAudioSink.getLastBufferedPTS ( )

Definition at line 1281 of file ALAudioSink.java.

Here is the caller graph for this function:

◆ getLatency()

float com.jogamp.openal.util.ALAudioSink.getLatency ( )

Definition at line 398 of file ALAudioSink.java.

◆ getNativeFormat()

final AudioFormat com.jogamp.openal.util.ALAudioSink.getNativeFormat ( )

Definition at line 401 of file ALAudioSink.java.

◆ getPerfString()

final String com.jogamp.openal.util.ALAudioSink.getPerfString ( )

Definition at line 382 of file ALAudioSink.java.

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

◆ getPlaySpeed()

final float com.jogamp.openal.util.ALAudioSink.getPlaySpeed ( )

Definition at line 1153 of file ALAudioSink.java.

◆ getPreferredFormat()

final AudioFormat com.jogamp.openal.util.ALAudioSink.getPreferredFormat ( )

Definition at line 409 of file ALAudioSink.java.

◆ getPTS()

final PTS com.jogamp.openal.util.ALAudioSink.getPTS ( )

Definition at line 1278 of file ALAudioSink.java.

Here is the caller graph for this function:

◆ getQueuedByteCount()

final int com.jogamp.openal.util.ALAudioSink.getQueuedByteCount ( )

Definition at line 1257 of file ALAudioSink.java.

◆ getQueuedDuration()

final float com.jogamp.openal.util.ALAudioSink.getQueuedDuration ( )

Definition at line 1265 of file ALAudioSink.java.

Here is the caller graph for this function:

◆ getQueuedFrameCount()

final int com.jogamp.openal.util.ALAudioSink.getQueuedFrameCount ( )

Definition at line 1241 of file ALAudioSink.java.

◆ getSource()

final Source com.jogamp.openal.util.ALAudioSink.getSource ( )

Return this instance's OpenAL Source.

Definition at line 324 of file ALAudioSink.java.

Here is the caller graph for this function:

◆ getSourceCount()

int com.jogamp.openal.util.ALAudioSink.getSourceCount ( )

Definition at line 392 of file ALAudioSink.java.

◆ getUseSOFTEvents()

final boolean com.jogamp.openal.util.ALAudioSink.getUseSOFTEvents ( final boolean  v)

Returns whether AL_SOFT_events is enabled, default if hasSOFTEvents().

Definition at line 341 of file ALAudioSink.java.

◆ getVolume()

final float com.jogamp.openal.util.ALAudioSink.getVolume ( )

Definition at line 1177 of file ALAudioSink.java.

◆ hasALCThreadLocalContext()

final boolean com.jogamp.openal.util.ALAudioSink.hasALCThreadLocalContext ( )

Return whether OpenAL extension ALC_EXT_thread_local_context is available.

Definition at line 335 of file ALAudioSink.java.

◆ hasEXTDouble()

final boolean com.jogamp.openal.util.ALAudioSink.hasEXTDouble ( )

Return whether OpenAL extension AL_EXT_DOUBLE is available.

Definition at line 333 of file ALAudioSink.java.

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

◆ hasEXTFloat32()

final boolean com.jogamp.openal.util.ALAudioSink.hasEXTFloat32 ( )

Return whether OpenAL extension AL_EXT_FLOAT32 is available.

Definition at line 331 of file ALAudioSink.java.

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

◆ hasEXTMcFormats()

final boolean com.jogamp.openal.util.ALAudioSink.hasEXTMcFormats ( )

Return whether OpenAL extension AL_EXT_MCFORMATS is available.

Definition at line 329 of file ALAudioSink.java.

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

◆ hasSOFTBufferSamples()

final boolean com.jogamp.openal.util.ALAudioSink.hasSOFTBufferSamples ( )

Return whether OpenAL extension AL_SOFT_buffer_samples is available.

Definition at line 327 of file ALAudioSink.java.

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

◆ hasSOFTEvents()

final boolean com.jogamp.openal.util.ALAudioSink.hasSOFTEvents ( )

Return whether OpenAL extension AL_SOFT_events is available.

Definition at line 337 of file ALAudioSink.java.

◆ init() [1/2]

final boolean com.jogamp.openal.util.ALAudioSink.init ( final AudioFormat  requestedFormat,
final int  frameDurationHint,
final int  queueSize 
)

Definition at line 474 of file ALAudioSink.java.

Here is the call graph for this function:

◆ init() [2/2]

final boolean com.jogamp.openal.util.ALAudioSink.init ( final int  alChannelLayout,
final int  alSampleType,
final int  alFormat,
final int  sampleRate,
final int  sampleSize,
final int  frameDurationHint,
final int  queueSize 
)

Initializes the sink using the given OpenAL audio parameter and streaming details.

Parameters
alChannelLayoutOpenAL channel layout
alSampleTypeOpenAL sample type
alFormatOpenAL format
sampleRatesample rate, e.g. 44100
sampleSizesample size in bits, e.g. 16
frameDurationHintaverage AudioFrame duration hint in milliseconds. Assists to adjust latency of the backend, as currently used for JOAL's ALAudioSink. A value below 30ms or DefaultFrameDuration may increase the audio processing load. Assumed as DefaultFrameDuration, if frameDuration < 1 ms.
queueSizequeue size in milliseconds, see DefaultQueueSize. Uses frameDurationHint to determine initial AudioFrame queue size.
Returns
true if successful, otherwise false
See also
enqueueData(int, ByteBuffer, int)
getAvgFrameDuration()
ALHelpers::getAudioFormat(int, int, int, int, int)
#init(AudioFormat, float, int)

Definition at line 518 of file ALAudioSink.java.

Here is the call graph for this function:

◆ isAvailable()

final boolean com.jogamp.openal.util.ALAudioSink.isAvailable ( )

Definition at line 716 of file ALAudioSink.java.

◆ isInitialized()

static boolean com.jogamp.openal.util.ALAudioSink.isInitialized ( )
static

Returns true if OpenAL has been loaded and static fields ALC, AL and ALExt have been initialized successfully, otherwise false.

Definition at line 158 of file ALAudioSink.java.

◆ isPlaying()

final boolean com.jogamp.openal.util.ALAudioSink.isPlaying ( )

Definition at line 1035 of file ALAudioSink.java.

Here is the call graph for this function:

◆ isSupported()

final boolean com.jogamp.openal.util.ALAudioSink.isSupported ( final AudioFormat  format)

Definition at line 443 of file ALAudioSink.java.

Here is the call graph for this function:

◆ makeCurrent()

final boolean com.jogamp.openal.util.ALAudioSink.makeCurrent ( final boolean  throwException)

Definition at line 353 of file ALAudioSink.java.

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

◆ pause()

final void com.jogamp.openal.util.ALAudioSink.pause ( )

Definition at line 1109 of file ALAudioSink.java.

Here is the call graph for this function:

◆ play()

final void com.jogamp.openal.util.ALAudioSink.play ( )

Definition at line 1086 of file ALAudioSink.java.

Here is the call graph for this function:

◆ release()

final boolean com.jogamp.openal.util.ALAudioSink.release ( final boolean  throwException)

Definition at line 357 of file ALAudioSink.java.

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

◆ setChannelLimit()

final void com.jogamp.openal.util.ALAudioSink.setChannelLimit ( final int  cc)

Definition at line 417 of file ALAudioSink.java.

◆ setPlaySpeed()

final boolean com.jogamp.openal.util.ALAudioSink.setPlaySpeed ( float  rate)

Definition at line 1156 of file ALAudioSink.java.

Here is the call graph for this function:

◆ setUseSOFTEvents()

final void com.jogamp.openal.util.ALAudioSink.setUseSOFTEvents ( final boolean  v)

Enable or disable AL_SOFT_events, default is enabled if hasSOFTEvents().

Definition at line 339 of file ALAudioSink.java.

◆ setVolume()

final boolean com.jogamp.openal.util.ALAudioSink.setVolume ( float  v)

Definition at line 1190 of file ALAudioSink.java.

Here is the call graph for this function:

◆ toString()

final String com.jogamp.openal.util.ALAudioSink.toString ( )

Definition at line 365 of file ALAudioSink.java.

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

◆ updateQueue()

final PTS com.jogamp.openal.util.ALAudioSink.updateQueue ( )

Definition at line 919 of file ALAudioSink.java.

Here is the call graph for this function:

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