We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Am i missing a .dll? q
Page Index Toggle Pages: 1
Am i missing a .dll?? q (Read 1328 times)
Am i missing a .dll?? q
Feb 13th, 2007, 12:54pm
 
Hi im trying to playback an audio file which has graphics that change behaviour when sound is outputted. The program works fine when ran in Proaceeing.However when i try to run in a PApplet in Eclipse the graphics are shown but no audio is outputted. Am i missing a DLL file in Eclipse which is in processing for audio playback??
Re: Am i missing a .dll?? q
Reply #1 - Feb 13th, 2007, 2:32pm
 
do have all the .jars needed for playback linked into your eclipse project?

what sound-libraries are you using? which version of core.jar?

F

(pease try not to open multiple threads for the same question. most of us use the rss-feed to track the recent posts, so if you feel your question's not getting answered, just ask (reply) it differntly in the thread you opened earlier.)
Re: Am i missing a .dll?? q
Reply #2 - Feb 13th, 2007, 2:58pm
 
I'm using the Ess library. And i have the Ess.jar and core.jar file imported to Eclipse. The program plays fine in processing, showing the graphic reacting to the sound. In Eclipse tho, the PApplet wont play the sound but it will show the graphic.No errors are printed. Sorry bout the multiple threads.Im using the 0124 version of processing so i took the core from that.
Re: Am i missing a .dll?? q
Reply #3 - Feb 13th, 2007, 3:10pm
 
so in eclipse the graphics react to the sound, but the sound is not audible?

what kind of soundfile do you use?

F
Re: Am i missing a .dll?? q
Reply #4 - Feb 13th, 2007, 3:18pm
 
No u see its showing the graphic but no sound is coming in at all..the graphic is being displayed but it isnt doing anything because no sound is being recieved.for some reason Eclipse isnt picking up the sound..I have other java sound programs that run fine just to let u know that its not Eclipse thats faulty.
Re: Am i missing a .dll?? q
Reply #5 - Feb 13th, 2007, 3:33pm
 
what kind of a soundfile is it? mp3?
Re: Am i missing a .dll?? q
Reply #6 - Feb 13th, 2007, 3:37pm
 
Its aiff
Re: Am i missing a .dll?? q
Reply #7 - Feb 13th, 2007, 3:55pm
 
A slightly different possibility on the problem, is that maybe when running in eclipse there are different assumptions being made about the default path for loading files. Processing assumes that the data directory of a sketch is the start point, whereas in eclipse it may assume differently.

I think that if this is the problem you could try dataPath("myfile.aiff") instead of just "myfile.aiff" in whatever loading function you're using.
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();
}




}
Re: Am i missing a .dll?? q
Reply #9 - Feb 13th, 2007, 4:00pm
 
note that with johns tip you need to place the soundfile inside a "data" folder inside the directory from where you are running your app ..

you say the above code runs fine in processing, but not in eclipse, right?

F
Re: Am i missing a .dll?? q
Reply #10 - Feb 13th, 2007, 4:17pm
 
Yes it wont run in Eclipse..i mean, it will show the graphic PApplet fine...but there is no audio
Re: Am i missing a .dll?? q
Reply #11 - Feb 13th, 2007, 7:30pm
 
Thanks anyways guys...i solved the problem Smiley
Page Index Toggle Pages: 1