Mercurial > jmeCapture
annotate src/com/aurellem/capture/audio/CompositeSoundProcessor.java @ 55:b05f629fc296
add contact info
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Dec 2011 19:18:38 -0600 |
parents | d799a0278cc9 |
children |
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 public class CompositeSoundProcessor implements SoundProcessor{ |
rlm@19 | 15 |
rlm@19 | 16 SoundProcessor[] processors; |
rlm@19 | 17 |
rlm@19 | 18 public CompositeSoundProcessor(SoundProcessor...processors){ |
rlm@19 | 19 this.processors = processors; |
rlm@19 | 20 } |
rlm@19 | 21 |
rlm@30 | 22 public void process(ByteBuffer audioSamples, int numSamples, AudioFormat format) { |
rlm@19 | 23 for (SoundProcessor sp : processors){ |
rlm@30 | 24 sp.process(audioSamples, numSamples, format); |
rlm@19 | 25 } |
rlm@19 | 26 } |
rlm@19 | 27 |
rlm@19 | 28 public void cleanup() { |
rlm@19 | 29 for (SoundProcessor sp : processors){ |
rlm@19 | 30 sp.cleanup(); |
rlm@19 | 31 } |
rlm@19 | 32 } |
rlm@19 | 33 } |