Package net.paulhertz.pixelaudio.example
Class TutorialOne_06_WindowBuffer.WindowedBuffer
java.lang.Object
net.paulhertz.pixelaudio.example.TutorialOne_06_WindowBuffer.WindowedBuffer
- Enclosing class:
- TutorialOne_06_WindowBuffer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float[]private intprivate intprivate final float[]private final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintExpose the underlying array sizeintExpose hop sizeintgetIndex()Current buffer indexfloat[]gettWindowAtIndex(int idx) Returns the window at a supplied index.intExpose the reusable window array sizefloat[]Returns the next window, advancing the read index by hopSize.voidreset()Reset reader to start of buffervoidsetHopSize(int hopSize) voidsetIndex(int index) set current index
-
Field Details
-
buffer
private final float[] buffer -
window
private final float[] window -
windowSize
private final int windowSize -
hopSize
private int hopSize -
index
private int index
-
-
Constructor Details
-
WindowedBuffer
public WindowedBuffer(float[] buffer, int windowSize, int hopSize)
-
-
Method Details
-
nextWindow
public float[] nextWindow()Returns the next window, advancing the read index by hopSize. Wraps around the buffer as needed. -
gettWindowAtIndex
public float[] gettWindowAtIndex(int idx) Returns the window at a supplied index. Wraps around the buffer as needed. Updates current index and advances it by hopSize. -
reset
public void reset()Reset reader to start of buffer -
getIndex
public int getIndex()Current buffer index -
setIndex
public void setIndex(int index) set current index -
getBufferSize
public int getBufferSize()Expose the underlying array size -
getWindowSize
public int getWindowSize()Expose the reusable window array size -
getHopSize
public int getHopSize()Expose hop size -
setHopSize
public void setHopSize(int hopSize)
-