Mercurial > jmeCapture
view src/com/aurellem/capture/audio/CompositeSoundProcessor.java @ 65:23e3df41db3c
reformatting for web
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 11 Feb 2012 12:25:26 -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 will9 * run the methods of each of its constituent SoundProcessors in the order10 * in which it was constructed.11 *12 * @author Robert McIntyre13 */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 }