view src/com/aurellem/capture/audio/CompositeSoundProcessor.java @ 30:be37291c62b8

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