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 › How to use mp3 file in processing
Page Index Toggle Pages: 1
How to use mp3 file in processing? (Read 4683 times)
How to use mp3 file in processing?
Apr 25th, 2006, 7:09pm
 
I am new to processing, i am working on a project about changing the sound volume by pressing button. But how can i use the mp3 file, do i needa input it to the libraries?
Re: How to use mp3 file in processing?
Reply #1 - Apr 25th, 2006, 7:45pm
 
PSound has been removed, you should use Ess or Sonia from the libraries pages instead.
Re: How to use mp3 file in processing?
Reply #2 - Apr 26th, 2006, 5:31am
 
I now using Ess for importing sound, but the processing is unble to load my mp3, so what can i do, the file is in the data folder of my sketch and here is the code

import krister.Ess.*;

Channel myChannel;

void setup() {
 size(256,200);

 // start up Ess
 Ess.start(this);

 // load "Intro.mp3" into a new Channel
 myChannel=new Channel();
 myChannel.loadSound("Intro.mp3");

 // start the sound looping forever
 myChannel.play(Ess.FOREVER);
}

void draw() {
}

// we are done, clean up Ess

public void stop() {
 Ess.stop();
 super.stop();
}

Is there something i did wrong?
Re: How to use mp3 file in processing?
Reply #3 - Apr 26th, 2006, 6:53am
 
It all looks good to me, but did you create a folder called “data” in the root of your sketch and put your mp3 in it. Also, did you follow the extra instructions for importing mp3s?
Re: How to use mp3 file in processing?
Reply #4 - Apr 26th, 2006, 5:37pm
 
what is the extra instrustion for importing mp3?
Re: How to use mp3 file in processing?
Reply #5 - Apr 26th, 2006, 8:09pm
 
they are on this page:

http://www.tree-axis.com/Ess/

Also try a few different sound file types like .wav and .mp3 along with different compressed mp3 - I read somewhere around here that ESS has trouble with some types of mp3s.
Re: How to use mp3 file in processing?
Reply #6 - Apr 27th, 2006, 2:19pm
 
in this page, http://www.tree-axis.com/Ess/
i have downloaded all three jar files and put it in the library in the Ess library file, but i still can't import the mp3 file into it, is it there's still some problems there? or should i use sonia to do that instead of Ess?
Re: How to use mp3 file in processing?
Reply #7 - Apr 27th, 2006, 9:17pm
 
Did you try a different mp3 file? The problem with Sonia is people have to use an extra plug-in to use your sketch in an applet.

What error are you getting when you try to import?
Re: How to use mp3 file in processing?
Reply #8 - May 17th, 2008, 1:52pm
 
I just got Krister's original code example working. Apart from putting your mp3 (check the file type!!) in the "data" folder, here are the three files you need to put in the "code" folder:

http://www.tree-axis.com/Ess/mp3_import.html

Though the volume of the sound is lower than needed Sad
Page Index Toggle Pages: 1