annotate src/com/aurellem/capture/audio/CompositeSoundProcessor.java @ 49:121b6d7e4d3f

more friendly AppSettings handling
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Dec 2011 13:22:27 -0600
parents be37291c62b8
children d799a0278cc9
rev   line source
rlm@19 1 package com.aurellem.capture.audio;
rlm@19 2
rlm@19 3 import java.nio.ByteBuffer;
rlm@19 4
rlm@30 5 import javax.sound.sampled.AudioFormat;
rlm@30 6
rlm@19 7 /**
rlm@19 8 * Method of Combination for sound processors. This SoundProcessor will
rlm@19 9 * run the methods of each of its constituent SoundProcessors in the order
rlm@19 10 * in which it was constructed.
rlm@19 11 *
rlm@19 12 * @author Robert McIntyre
rlm@19 13 *
rlm@19 14 */
rlm@19 15 public class CompositeSoundProcessor implements SoundProcessor{
rlm@19 16
rlm@19 17 SoundProcessor[] processors;
rlm@19 18
rlm@19 19 public CompositeSoundProcessor(SoundProcessor...processors){
rlm@19 20 this.processors = processors;
rlm@19 21 }
rlm@19 22
rlm@30 23 public void process(ByteBuffer audioSamples, int numSamples, AudioFormat format) {
rlm@19 24 for (SoundProcessor sp : processors){
rlm@30 25 sp.process(audioSamples, numSamples, format);
rlm@19 26 }
rlm@19 27 }
rlm@19 28
rlm@19 29 public void cleanup() {
rlm@19 30 for (SoundProcessor sp : processors){
rlm@19 31 sp.cleanup();
rlm@19 32 }
rlm@19 33 }
rlm@19 34 }