Hi Everyone,
I try to stream an mp3 in Ess (not with AudioChannel, but with AudioFile and AudioStream).
When run from the processing environment, it works fine. When I compile to an applet and double-click on index.html, it doesn't ever work, I always get an "unable to load sound ----.mp3" in my browser java console
-Have tried running it locally, and uploading it to a web folder. Same thing both times.
-I have all the additional 3 mp3 libraries in the right place, and they compile into the applet folder fine
-I have tried loading a local sound (in the data folder) and an mp3 at a website. Same error both times.
Here's the code, it is just the same as the Ess mp3 stream example
Code:
import krister.Ess.*;
AudioStream myStream;
AudioFile myFile;
boolean songDone;
void setup() {
size(256,200);
Ess.start(this);
//I also tried this below, loading it locally when packed into mp3test2.jar, same error
//myFile=new AudioFile("groove.mp3",0,Ess.READ);
myFile=new AudioFile("http://music.columbia.edu/~daniglesia/video/mp3test2/groove.mp3",0,Ess.READ);
myStream=new AudioStream();
myStream.sampleRate(myFile.sampleRate);
myStream.start();
}
void draw() {
}
void audioStreamWrite(AudioStream theStream) {
int samplesRead=myFile.read(myStream);
if (samplesRead==0)myFile.close();
}
public void stop() {
Ess.stop();
super.stop();
}
Could it have something to do with the Processing switch to the native applet launcher?
Any suggestions would be greatly appreciated! Have been banging my head on this for many hours...
Thanks, Dan