view src/com/aurellem/capture/audio/CompositeSoundProcessor.java @ 64:155c70b7e6de

removed cursing
author Robert McIntyre <rlm@mit.edu>
date Fri, 10 Feb 2012 04:07:05 -0700
parents d799a0278cc9
children
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 public class CompositeSoundProcessor implements SoundProcessor{
16 SoundProcessor[] processors;
18 public CompositeSoundProcessor(SoundProcessor...processors){
19 this.processors = processors;
20 }
22 public void process(ByteBuffer audioSamples, int numSamples, AudioFormat format) {
23 for (SoundProcessor sp : processors){
24 sp.process(audioSamples, numSamples, format);
25 }
26 }
28 public void cleanup() {
29 for (SoundProcessor sp : processors){
30 sp.cleanup();
31 }
32 }
33 }