comparison src/com/aurellem/capture/audio/CompositeSoundProcessor.java @ 27:5249c8a9603c

changed SoundProcessors to use AudioFormat
author Robert McIntyre <rlm@mit.edu>
date Sun, 30 Oct 2011 08:10:26 -0700
parents 4de7988407ef
children
comparison
equal deleted inserted replaced
26:95648b0c12bc 27:5249c8a9603c
1 package com.aurellem.capture.audio; 1 package com.aurellem.capture.audio;
2 2
3 import java.nio.ByteBuffer; 3 import java.nio.ByteBuffer;
4
5 import javax.sound.sampled.AudioFormat;
4 6
5 /** 7 /**
6 * Method of Combination for sound processors. This SoundProcessor will 8 * Method of Combination for sound processors. This SoundProcessor will
7 * run the methods of each of its constituent SoundProcessors in the order 9 * run the methods of each of its constituent SoundProcessors in the order
8 * in which it was constructed. 10 * in which it was constructed.
16 18
17 public CompositeSoundProcessor(SoundProcessor...processors){ 19 public CompositeSoundProcessor(SoundProcessor...processors){
18 this.processors = processors; 20 this.processors = processors;
19 } 21 }
20 22
21 public void process(ByteBuffer audioSamples, int numSamples) { 23 public void process(ByteBuffer audioSamples, AudioFormat format, int numSamples) {
22 for (SoundProcessor sp : processors){ 24 for (SoundProcessor sp : processors){
23 sp.process(audioSamples, numSamples); 25 sp.process(audioSamples, format, numSamples);
24 } 26 }
25 } 27 }
26 28
27 public void cleanup() { 29 public void cleanup() {
28 for (SoundProcessor sp : processors){ 30 for (SoundProcessor sp : processors){
29 sp.cleanup(); 31 sp.cleanup();
30 } 32 }
31 } 33 }
34
32 } 35 }