# HG changeset patch # User Robert McIntyre # Date 1319994681 25200 # Node ID be37291c62b8cf03bf565a32b7907a02b8269c41 # Parent 9f58273090df2de7955996525130014f170f2657 propagated AudioFormat to other classes. diff -r 9f58273090df -r be37291c62b8 src/com/aurellem/capture/audio/AudioSendRenderer.java --- a/src/com/aurellem/capture/audio/AudioSendRenderer.java Sun Oct 30 10:06:38 2011 -0700 +++ b/src/com/aurellem/capture/audio/AudioSendRenderer.java Sun Oct 30 10:11:21 2011 -0700 @@ -184,7 +184,7 @@ audioSend.getSamples(buffer, samplesToGet, i); SoundProcessor sp = this.soundProcessorMap.get(this.listeners.get(i)); - if (null != sp){sp.process(buffer, samplesToGet*outFormat.getFrameSize());} + if (null != sp){sp.process(buffer, samplesToGet*outFormat.getFrameSize(), outFormat);} } } diff -r 9f58273090df -r be37291c62b8 src/com/aurellem/capture/audio/CompositeSoundProcessor.java --- a/src/com/aurellem/capture/audio/CompositeSoundProcessor.java Sun Oct 30 10:06:38 2011 -0700 +++ b/src/com/aurellem/capture/audio/CompositeSoundProcessor.java Sun Oct 30 10:11:21 2011 -0700 @@ -2,6 +2,8 @@ import java.nio.ByteBuffer; +import javax.sound.sampled.AudioFormat; + /** * Method of Combination for sound processors. This SoundProcessor will * run the methods of each of its constituent SoundProcessors in the order @@ -18,9 +20,9 @@ this.processors = processors; } - public void process(ByteBuffer audioSamples, int numSamples) { + public void process(ByteBuffer audioSamples, int numSamples, AudioFormat format) { for (SoundProcessor sp : processors){ - sp.process(audioSamples, numSamples); + sp.process(audioSamples, numSamples, format); } } diff -r 9f58273090df -r be37291c62b8 src/com/aurellem/capture/audio/SoundProcessor.java --- a/src/com/aurellem/capture/audio/SoundProcessor.java Sun Oct 30 10:06:38 2011 -0700 +++ b/src/com/aurellem/capture/audio/SoundProcessor.java Sun Oct 30 10:11:21 2011 -0700 @@ -2,10 +2,12 @@ import java.nio.ByteBuffer; +import javax.sound.sampled.AudioFormat; + public interface SoundProcessor { void cleanup(); - void process(ByteBuffer audioSamples, int numSamples); + void process(ByteBuffer audioSamples, int numSamples, AudioFormat format); } diff -r 9f58273090df -r be37291c62b8 src/com/aurellem/capture/audio/WaveFileWriter.java --- a/src/com/aurellem/capture/audio/WaveFileWriter.java Sun Oct 30 10:06:38 2011 -0700 +++ b/src/com/aurellem/capture/audio/WaveFileWriter.java Sun Oct 30 10:11:21 2011 -0700 @@ -31,7 +31,7 @@ } - public void process(ByteBuffer audioSamples, int numSamples) { + public void process(ByteBuffer audioSamples, int numSamples, AudioFormat format) { byte[] data = new byte[numSamples]; audioSamples.get(data, 0, numSamples); try {wao.write(data, 0, numSamples);} diff -r 9f58273090df -r be37291c62b8 src/com/aurellem/capture/examples/AdvancedAudio.java --- a/src/com/aurellem/capture/examples/AdvancedAudio.java Sun Oct 30 10:06:38 2011 -0700 +++ b/src/com/aurellem/capture/examples/AdvancedAudio.java Sun Oct 30 10:11:21 2011 -0700 @@ -3,6 +3,8 @@ import java.io.File; import java.nio.ByteBuffer; +import javax.sound.sampled.AudioFormat; + import com.aurellem.capture.IsoTimer; import com.aurellem.capture.audio.MultiListener; import com.aurellem.capture.audio.SoundProcessor; @@ -235,7 +237,7 @@ * Dance to the beat! This is the brain of an AI entity that * hears it's surroundings and reacts to them. */ - public void process(ByteBuffer audioSamples, int numSamples) { + public void process(ByteBuffer audioSamples, int numSamples, AudioFormat format) { //System.out.println("I'm DANCING <3"); entity.scale(this.scale); if (this.scale == 2f){this.scale = 0.5f;}