FixedSizeSampleAudioProcessor extends AudioProcessor { @Override public SampleChunk process(final SampleChunk sample) throws Exception { return sample; } FixedSizeSampleAudioProcessor(final int sizeRequired);  FixedSizeSampleAudioProcessor(final AudioStream stream, final int sizeRequired);  FixedSizeSampleAudioProcessor(final int nSamplesInWindow,
			final int nSamplesOverlap);  FixedSizeSampleAudioProcessor(final AudioStream as, final int nSamplesInWindow,
			final int nSamplesOverlap); @Override SampleChunk nextSampleChunk(); void setWindowStep(final int overlap); int getWindowStep(); void setWindowSize(final int sizeRequired); int getWindowSize(); boolean isOverlapping(); @Override SampleChunk process(final SampleChunk sample);  }
@Test public void testSampleSize() { FixedSizeSampleAudioProcessor fssap = new FixedSizeSampleAudioProcessor(256) { @Override public SampleChunk process( SampleChunk sample ) { System.out.println( count+" : "+Arrays.toString( sample.getSamples() ) ); Assert.assertEquals( 256, sample.getNumberOfSamples() ); Assert.assertEquals( 512, sample.getSamples().length ); Assert.assertEquals( 0, sample.getSamples()[0] ); Assert.assertEquals( 127, sample.getSamples()[255] ); count++; return sample; } }; try { fssap.process( audio ); } catch( Exception e ) { e.printStackTrace(); } Assert.assertEquals( 65536/2/256, count ); }