rlm@19: package com.aurellem.capture.audio; rlm@19: rlm@19: import java.nio.ByteBuffer; rlm@19: rlm@30: import javax.sound.sampled.AudioFormat; rlm@30: rlm@19: /** rlm@19: * Method of Combination for sound processors. This SoundProcessor will rlm@19: * run the methods of each of its constituent SoundProcessors in the order rlm@19: * in which it was constructed. rlm@19: * rlm@19: * @author Robert McIntyre rlm@19: */ rlm@19: public class CompositeSoundProcessor implements SoundProcessor{ rlm@19: rlm@19: SoundProcessor[] processors; rlm@19: rlm@19: public CompositeSoundProcessor(SoundProcessor...processors){ rlm@19: this.processors = processors; rlm@19: } rlm@19: rlm@30: public void process(ByteBuffer audioSamples, int numSamples, AudioFormat format) { rlm@19: for (SoundProcessor sp : processors){ rlm@30: sp.process(audioSamples, numSamples, format); rlm@19: } rlm@19: } rlm@19: rlm@19: public void cleanup() { rlm@19: for (SoundProcessor sp : processors){ rlm@19: sp.cleanup(); rlm@19: } rlm@19: } rlm@19: }