Neo_proc
Junior Member
Offline
Posts: 66
Re: Am i missing a .dll?? q
Reply #8 - Feb 13th , 2007, 3:59pm
Heres the code....can u please specify?? package GUI1; import processing.core.PApplet; import krister.Ess.*; import java.io.*; import javax.sound.*; import javazoom.jl.*; public class Embedded extends PApplet { AudioStream myStream; AudioFile myFile; File sFile; boolean songDone; public void setup() { size(200,200); // start up Ess Ess.start(this); // get ready to stream KCRW // (Ess.READ does not require a sample rate) myFile = new AudioFile("C:/Documents and Settings/TEMP.COMPUTING/Desktop/counting.aiff",0,Ess.READ); //MainTitles //Bombtrack // create a new AudioStream and set the sample rate myStream=new AudioStream(32*1024); // 32k samples myStream.sampleRate(myFile.sampleRate); myStream.start(); frameRate(30); } public void draw() { background(0,0,255); // draw waveform int interp=(int)max(0,(((millis()-myStream.bufferStartTime)/(float)myStream.duration )*myStream.size)); for (int i=0;i<256;i++) { int top=50; if (i+interp<myStream.buffer2.length) top-=(int)(myStream.buffer2[i+interp]*50.0); int j=0; for (int k=top;k<height;k++) { set(i,k,color(j,j,255)); j=min(j+2,255); } } } void audioStreamWrite(AudioStream theStream) { // read the next chunk int samplesRead=myFile.read(myStream); if (samplesRead==0) { // start over myFile.close(); myFile.open("C:/Documents and Settings/TEMP.COMPUTING/Desktop/counting.aiff",myStream.sampleRate,Ess.READ); samplesRead=myFile.read(myStream); } } // we are done, clean up Ess public void stop() { Ess.stop(); super.stop(); } }