comparison src/com/aurellem/capture/examples/AdvancedAudio.java @ 27:5249c8a9603c

changed SoundProcessors to use AudioFormat
author Robert McIntyre <rlm@mit.edu>
date Sun, 30 Oct 2011 08:10:26 -0700
parents 25fcf5fda505
children 7184bc09a92e
comparison
equal deleted inserted replaced
26:95648b0c12bc 27:5249c8a9603c
1 package com.aurellem.capture.examples; 1 package com.aurellem.capture.examples;
2 2
3 import java.io.File; 3 import java.io.File;
4 import java.nio.ByteBuffer; 4 import java.nio.ByteBuffer;
5
6 import javax.sound.sampled.AudioFormat;
5 7
6 import com.aurellem.capture.IsoTimer; 8 import com.aurellem.capture.IsoTimer;
7 import com.aurellem.capture.audio.MultiListener; 9 import com.aurellem.capture.audio.MultiListener;
8 import com.aurellem.capture.audio.SoundProcessor; 10 import com.aurellem.capture.audio.SoundProcessor;
9 import com.jme3.app.SimpleApplication; 11 import com.jme3.app.SimpleApplication;
233 235
234 /** 236 /**
235 * Dance to the beat! This is the brain of an AI entity that 237 * Dance to the beat! This is the brain of an AI entity that
236 * hears it's surroundings and reacts to them. 238 * hears it's surroundings and reacts to them.
237 */ 239 */
238 public void process(ByteBuffer audioSamples, int numSamples) { 240 public void process(ByteBuffer audioSamples, AudioFormat format, int numSamples) {
239 //System.out.println("I'm DANCING <3"); 241 //System.out.println("I'm DANCING <3");
240 entity.scale(this.scale); 242 entity.scale(this.scale);
241 if (this.scale == 2f){this.scale = 0.5f;} 243 if (this.scale == 2f){this.scale = 0.5f;}
242 else {this.scale = 2;} 244 else {this.scale = 2;}
243 } 245 }