Interface AudioStream

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
FiniteAudioStream, FloatSampleSource
All Known Implementing Classes:
ClientTests.SineStream, JOrbisAudioStream, LoopingAudioStream

public interface AudioStream extends Closeable
  • Method Summary

    Modifier and Type
    Method
    Description
     
    read(int pSize)
    Reads audio data from the stream and returns a byte buffer containing at most the specified number of bytes.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • getFormat

      AudioFormat getFormat()
    • read

      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.
      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