Mercurial > jmeCapture
view src/com/aurellem/capture/audio/CompositeSoundProcessor.java @ 56:afc437f637bd
improved formating
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Dec 2011 19:25:27 -0600 |
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 }