Class Wave

java.lang.Object
com.raylib.Wave

public class Wave extends Object
Wave, audio wave data
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 specified
    Wave(MemorySegment memorySegment)
    Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    Construct with your owm memory allocator and fields not initialized
    Wave(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 Type
    Method
    Description
    static Wave
    allocateArray(long elementCount)
    Allocate an array of Wave
    static Wave
    allocateArray(long elementCount, SegmentAllocator allocator)
    Allocate an array of Wave
    int
    Number of channels (1-mono, 2-stereo, ...)
    channels(int value)
    Number of channels (1-mono, 2-stereo, ...)
    Buffer data pointer
    Buffer data pointer
    boolean
    Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
    int
    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, ...)
    Buffer data pointer
    int
    Total number of frames (considering channels)
    int
    Frequency (samples per second)
    int
    Bit depth (bits per sample): 8, 16, 32 (24 not supported)
    int
     
    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
    Buffer data pointer
    void
    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)

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • memorySegment

      public final MemorySegment 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

      public Wave(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Wave

      public Wave(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Wave

      public Wave(int frameCount, int sampleRate, int sampleSize, int channels, MemorySegment data)
      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

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getArrayElement

      public Wave getArrayElement(int index)
    • allocateArray

      public static Wave allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Wave
    • allocateArray

      public static Wave allocateArray(long elementCount)
      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

      public Wave frameCount(int value)
      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

      public Wave sampleRate(int value)
      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

      public Wave sampleSize(int value)
      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

      public Wave channels(int value)
      Number of channels (1-mono, 2-stereo, ...)
    • getData

      public MemorySegment getData()
      Buffer data pointer
    • setData

      public void setData(MemorySegment value)
      Buffer data pointer
    • data

      public MemorySegment data()
      Buffer data pointer
    • data

      public Wave data(MemorySegment value)
      Buffer data pointer