Package com.io7m.jsamplebuffer.api
Interface SampleBufferReadableType
-
- All Known Subinterfaces:
SampleBufferType
- All Known Implementing Classes:
SampleBufferDouble,SampleBufferFloat
public interface SampleBufferReadableTypeA 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 throwcom.io7m.jranges.RangeCheckExceptionexceptions if the indices are out of range.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intchannels()doubleframeGetExact(long index)Get the value of frameindex.voidframeGetExact(long index, double[] output)Get the value of frameindex.longframes()doublesampleRate()default longsamples()
-
-
-
Method Detail
-
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 frameindex.- Parameters:
index- The frame indexoutput- The output- Throws:
java.lang.IllegalArgumentException- Ifoutput.length != channels()
-
frameGetExact
double frameGetExact(long index)
Get the value of frameindex.- Parameters:
index- The frame index- Returns:
- The value in the frame
- Throws:
java.lang.IllegalArgumentException- If1 != channels()
-
-