Class Music

java.lang.Object
com.raylib.Music

public class Music extends Object
Music, audio stream, anything longer than ~10 seconds should be streamed
  • Field Details

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Music

      public Music()
      Construct with auto memory allocator and fields initialized to zero.
    • Music

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

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

      public Music(AudioStream stream, int frameCount, boolean looping, int ctxType, MemorySegment ctxData)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      stream - Audio stream
      frameCount - Total number of frames (considering channels)
      looping - Music looping enable
      ctxType - Type of music context (audio filetype)
      ctxData - Audio context data, depends on type
    • Music

      public Music(SegmentAllocator arena, AudioStream stream, int frameCount, boolean looping, int ctxType, MemorySegment ctxData)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      stream - Audio stream
      frameCount - Total number of frames (considering channels)
      looping - Music looping enable
      ctxType - Type of music context (audio filetype)
      ctxData - Audio context data, depends on type
  • 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 Music getArrayElement(int index)
    • allocateArray

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

      public static Music allocateArray(long elementCount)
      Allocate an array of Music
    • getStream

      public AudioStream getStream()
      Audio stream
    • setStream

      public void setStream(AudioStream value)
      Audio stream
    • stream

      public AudioStream stream()
      Audio stream
    • stream

      public Music stream(AudioStream value)
      Audio stream
    • 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 Music frameCount(int value)
      Total number of frames (considering channels)
    • getLooping

      public boolean getLooping()
      Music looping enable
    • setLooping

      public void setLooping(boolean value)
      Music looping enable
    • looping

      public boolean looping()
      Music looping enable
    • looping

      public Music looping(boolean value)
      Music looping enable
    • getCtxType

      public int getCtxType()
      Type of music context (audio filetype)
    • setCtxType

      public void setCtxType(int value)
      Type of music context (audio filetype)
    • ctxType

      public int ctxType()
      Type of music context (audio filetype)
    • ctxType

      public Music ctxType(int value)
      Type of music context (audio filetype)
    • getCtxData

      public MemorySegment getCtxData()
      Audio context data, depends on type
    • setCtxData

      public void setCtxData(MemorySegment value)
      Audio context data, depends on type
    • ctxData

      public MemorySegment ctxData()
      Audio context data, depends on type
    • ctxData

      public Music ctxData(MemorySegment value)
      Audio context data, depends on type