Class Wave
java.lang.Object
com.raylib.Wave
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal MemorySegment
The native FFI MemorySegment that holds the data this object wraps. -
Constructor Summary
ConstructorsConstructorDescriptionWave()
Construct with auto memory allocator and fields initialized to zero.Wave
(int frameCount, int sampleRate, int sampleSize, int channels, MemorySegment data) Construct with auto memory allocator and fields initialized as specifiedWave
(MemorySegment memorySegment) Construct by wrapping around an already allocated MemorySegment, perhaps from another objectWave
(SegmentAllocator arena) Construct with your owm memory allocator and fields not initializedWave
(SegmentAllocator arena, int frameCount, int sampleRate, int sampleSize, int channels, MemorySegment data) Construct with your own memory allocator and fields initialized as specified -
Method Summary
Modifier and TypeMethodDescriptionstatic Wave
allocateArray
(long elementCount) Allocate an array of Wavestatic Wave
allocateArray
(long elementCount, SegmentAllocator allocator) Allocate an array of Waveint
channels()
Number of channels (1-mono, 2-stereo, ...)channels
(int value) Number of channels (1-mono, 2-stereo, ...)data()
Buffer data pointerdata
(MemorySegment value) Buffer data pointerboolean
Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equalint
Total number of frames (considering channels)frameCount
(int value) Total number of frames (considering channels)getArrayElement
(int index) int
Number of channels (1-mono, 2-stereo, ...)getData()
Buffer data pointerint
Total number of frames (considering channels)int
Frequency (samples per second)int
Bit depth (bits per sample): 8, 16, 32 (24 not supported)int
hashCode()
int
Frequency (samples per second)sampleRate
(int value) Frequency (samples per second)int
Bit depth (bits per sample): 8, 16, 32 (24 not supported)sampleSize
(int value) Bit depth (bits per sample): 8, 16, 32 (24 not supported)void
setChannels
(int value) Number of channels (1-mono, 2-stereo, ...)void
setData
(MemorySegment value) Buffer data pointervoid
setFrameCount
(int value) Total number of frames (considering channels)void
setSampleRate
(int value) Frequency (samples per second)void
setSampleSize
(int value) Bit depth (bits per sample): 8, 16, 32 (24 not supported)
-
Field Details
-
memorySegment
The native FFI MemorySegment that holds the data this object wraps.
-
-
Constructor Details
-
Wave
public Wave()Construct with auto memory allocator and fields initialized to zero. -
Wave
Construct with your owm memory allocator and fields not initialized -
Wave
Construct by wrapping around an already allocated MemorySegment, perhaps from another object -
Wave
Construct with auto memory allocator and fields initialized as specified- Parameters:
frameCount
- Total number of frames (considering channels)sampleRate
- Frequency (samples per second)sampleSize
- Bit depth (bits per sample): 8, 16, 32 (24 not supported)channels
- Number of channels (1-mono, 2-stereo, ...)data
- Buffer data pointer
-
Wave
public Wave(SegmentAllocator arena, int frameCount, int sampleRate, int sampleSize, int channels, MemorySegment data) Construct with your own memory allocator and fields initialized as specified- Parameters:
frameCount
- Total number of frames (considering channels)sampleRate
- Frequency (samples per second)sampleSize
- Bit depth (bits per sample): 8, 16, 32 (24 not supported)channels
- Number of channels (1-mono, 2-stereo, ...)data
- Buffer data pointer
-
-
Method Details
-
equals
-
hashCode
-
getArrayElement
-
allocateArray
Allocate an array of Wave -
allocateArray
Allocate an array of Wave -
getFrameCount
public int getFrameCount()Total number of frames (considering channels) -
setFrameCount
public void setFrameCount(int value) Total number of frames (considering channels) -
frameCount
public int frameCount()Total number of frames (considering channels) -
frameCount
Total number of frames (considering channels) -
getSampleRate
public int getSampleRate()Frequency (samples per second) -
setSampleRate
public void setSampleRate(int value) Frequency (samples per second) -
sampleRate
public int sampleRate()Frequency (samples per second) -
sampleRate
Frequency (samples per second) -
getSampleSize
public int getSampleSize()Bit depth (bits per sample): 8, 16, 32 (24 not supported) -
setSampleSize
public void setSampleSize(int value) Bit depth (bits per sample): 8, 16, 32 (24 not supported) -
sampleSize
public int sampleSize()Bit depth (bits per sample): 8, 16, 32 (24 not supported) -
sampleSize
Bit depth (bits per sample): 8, 16, 32 (24 not supported) -
getChannels
public int getChannels()Number of channels (1-mono, 2-stereo, ...) -
setChannels
public void setChannels(int value) Number of channels (1-mono, 2-stereo, ...) -
channels
public int channels()Number of channels (1-mono, 2-stereo, ...) -
channels
Number of channels (1-mono, 2-stereo, ...) -
getData
Buffer data pointer -
setData
Buffer data pointer -
data
Buffer data pointer -
data
Buffer data pointer
-