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 & HelpSound,  Music Libraries › streaming mp3 with Ess...trouble
Page Index Toggle Pages: 1
streaming mp3 with Ess...trouble (Read 821 times)
streaming mp3 with Ess...trouble
Apr 18th, 2010, 6:36pm
 
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
Page Index Toggle Pages: 1