Interface SampleBufferReadableType

All Known Subinterfaces:
SampleBufferType
All Known Implementing Classes:
SampleBufferDouble, SampleBufferFloat

public interface SampleBufferReadableType
A readable sample buffer. A sample buffer is an abstraction over a block of audio data. The sample buffer pretends that the audio is interleaved (such that all of the samples for a given frame are stored consecutively) and consists of double-precision floating-point samples. Sample buffers may store audio differently internally, and may store using a lower level of precision than the double-precision API implies. All methods that take sample/frame indices as arguments throw com.io7m.jranges.RangeCheckException exceptions if the indices are out of range.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    double
    frameGetExact(long index)
    Get the value of frame index.
    void
    frameGetExact(long index, double[] output)
    Get the value of frame index.
    long
     
    double
     
    default long
     
  • Method Details

    • channels

      int channels()
      Returns:
      The number of channels in a frame
    • frames

      long frames()
      Returns:
      The number of frames in the buffer
    • sampleRate

      double sampleRate()
      Returns:
      The sample rate in hz
    • samples

      default long samples()
      Returns:
      The number of samples in the buffer
    • frameGetExact

      void frameGetExact(long index, double[] output)
      Get the value of frame index.
      Parameters:
      index - The frame index
      output - The output
      Throws:
      IllegalArgumentException - If output.length != channels()
    • frameGetExact

      double frameGetExact(long index)
      Get the value of frame index.
      Parameters:
      index - The frame index
      Returns:
      The value in the frame
      Throws:
      IllegalArgumentException - If 1 != channels()