Package io.github.libsdl4j.api.audio
Class SDL_AudioSpec
- java.lang.Object
-
- com.sun.jna.Structure
-
- io.github.libsdl4j.api.audio.SDL_AudioSpec
-
@FieldOrder({"freq","format","channels","silence","samples","padding","size","callback","userdata"}) public final class SDL_AudioSpec extends com.sun.jna.Structure
The calculated values in this structure are calculated by SDL_OpenAudio().
For multi-channel audio, the default SDL channel mapping is:
2: FL FR (stereo) 3: FL FR LFE (2.1 surround) 4: FL FR BL BR (quad) 5: FL FR LFE BL BR (4.1 surround) 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) 7: FL FR FC LFE BC SL SR (6.1 surround) 8: FL FR FC LFE BL BR SL SR (7.1 surround)
-
-
Field Summary
Fields Modifier and Type Field Description SDL_AudioCallback
callback
Callback that feeds the audio device (NULL to use SDL_QueueAudio()).byte
channels
Number of channels: 1 mono, 2 stereoSDL_AudioFormat
format
Audio data formatint
freq
DSP frequency -- samples per secondshort
padding
Necessary for some compile environmentsshort
samples
Audio buffer size in sample FRAMES (total samples divided by channel count)byte
silence
Audio buffer silence value (calculated)int
size
Audio buffer size in bytes (calculated)com.sun.jna.Pointer
userdata
Userdata passed to callback (ignored for NULL callbacks).
-
Constructor Summary
Constructors Constructor Description SDL_AudioSpec()
SDL_AudioSpec(com.sun.jna.Pointer p)
-
Method Summary
-
Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFieldOrder, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
-
-
-
Field Detail
-
freq
public int freq
DSP frequency -- samples per second
-
format
public SDL_AudioFormat format
Audio data format
-
channels
public byte channels
Number of channels: 1 mono, 2 stereo
-
silence
public byte silence
Audio buffer silence value (calculated)
-
samples
public short samples
Audio buffer size in sample FRAMES (total samples divided by channel count)
-
padding
public short padding
Necessary for some compile environments
-
size
public int size
Audio buffer size in bytes (calculated)
-
callback
public SDL_AudioCallback callback
Callback that feeds the audio device (NULL to use SDL_QueueAudio()).
-
userdata
public com.sun.jna.Pointer userdata
Userdata passed to callback (ignored for NULL callbacks).
-
-