Interface FloatSampleSource

All Superinterfaces:
AudioStream, AutoCloseable, Closeable, FiniteAudioStream
All Known Implementing Classes:
JOrbisAudioStream

public interface FloatSampleSource extends FiniteAudioStream
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default ByteBuffer
    read(int pSize)
    Reads audio data from the stream and returns a byte buffer containing at most the specified number of bytes.
    default ByteBuffer
     
    boolean
    readChunk(it.unimi.dsi.fastutil.floats.FloatConsumer p_340937_)
     

    Methods inherited from interface net.minecraft.client.sounds.AudioStream

    getFormat

    Methods inherited from interface java.io.Closeable

    close
  • Field Details

  • Method Details

    • readChunk

      boolean readChunk(it.unimi.dsi.fastutil.floats.FloatConsumer p_340937_) throws IOException
      Throws:
      IOException
    • read

      default ByteBuffer read(int pSize) throws IOException
      Reads audio data from the stream and returns a byte buffer containing at most the specified number of bytes. The method reads audio frames from the stream and adds them to the output buffer until the buffer contains at least the specified number of bytes or the end fo the stream is reached.
      Specified by:
      read in interface AudioStream
      Parameters:
      pSize - the maximum number of bytes to read
      Returns:
      a byte buffer containing at most the specified number of bytes to read
      Throws:
      IOException - if an I/O error occurs while reading the audio data
    • readAll

      default ByteBuffer readAll() throws IOException
      Specified by:
      readAll in interface FiniteAudioStream
      Throws:
      IOException