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.
Page Index Toggle Pages: 1
minim (Read 2941 times)
minim
Nov 13th, 2008, 9:54pm
 
I'm using minim audiosnippets and I'm hearing a little muffled click or two at the end of each sample... those aren't audible when I play the wav file elsewhere. i don't remember it happening with older versions of minm... am I doing something wrong?


import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;



AudioSnippet song[] = new AudioSnippet[10];

Minim minim;

void setup()
{
 size(200, 200);
 // always start Minim first
minim = new Minim(this);
 // load a file into an AudioSnippet
 // it must be in this sketches data folder
 for(int i = 0; i < 10; i++){
 song[i] = minim.loadSnippet("scream"+i+".wav");
 }
}

void draw()
{
 background(0);
}

void keyPressed()
{
 if ( key >= '0' && key <= '9' )
 {
   int s = key - '0';
   println(s);
   song[s].rewind();
   song[s].play();
 }
}

void stop()
{
 // always close Minim audio classes
for(int i = 0; i < 10; i++){
 song[i].close();
}
 minim.stop();
 super.stop();
}
Re: minim
Reply #1 - Nov 14th, 2008, 4:38pm
 
Here is a zip file the WAVs I was using:

http://kisrael.com/m/2008.11.14.data.zip

any thoughts appreciated!
Re: minim
Reply #2 - Nov 17th, 2008, 11:16pm
 
Is there a better place to go ask about this?
Re: minim
Reply #3 - Nov 25th, 2008, 4:54am
 
This is a good place to ask, I've just not been visiting the forums very regularly lately. The click has probably been introduced by me. More recent versions of Minim no long use the built in Clip interface for the implementation of AudioSnippet, so I'm handling the end of file case poorly. I'll make a note of it and hopefully get it fixed in a future release. Thanks for posting a link to the WAVs you are using.
Re: minim
Reply #4 - Feb 7th, 2009, 8:28pm
 
ddf wrote on Nov 25th, 2008, 4:54am:
This is a good place to ask, I've just not been visiting the forums very regularly lately. The click has probably been introduced by me. More recent versions of Minim no long use the built in Clip interface for the implementation of AudioSnippet, so I'm handling the end of file case poorly. I'll make a note of it and hopefully get it fixed in a future release. Thanks for posting a link to the WAVs you are using.

ddf are you ever going to get back to this
It was really painful for me last weekend (as my annoying, naggy, "what's going on" thread attests to) because I thought I was in the clear with 2.02 -- but then right as we go to demo it, it shows up again.

Re: minim
Reply #5 - Oct 1st, 2009, 12:57pm
 
Whoa. The time crappity smacking flies. I apologize for not being able to really look at this sooner. February was the beginning of crazy times at my job and it has only recently slowed down. I'm going to look at this right now, using your files.

Initial inspection leads me to believe that it has something to do with the audio format: 11Khz, 8 bit, mono. This is not a file format I typically test with, but it's good you've provided me some. Def hear the annoyingly loud click and I can see why it would upset you so much.

Again, apologize you had to move forward with your project under these circumstances. For the time being, I suspect that if you use files that are at a higher sample rate, you won't have problems.
Re: minim
Reply #6 - Oct 1st, 2009, 2:20pm
 
Ah ha! Figured it out. Your audio files are PCM_UNSIGNED and when I got to the end of the sample I'd fill out the remainer of my byte buffer that was sent to the output with "silence", but I was assuming a PCM_SIGNED format and filling it with 0. But if the format is unsigned then 0 is the smallest value a sample can be, as opposed to the neutral "silent" value.

So, this will be fixed in the next release, which should be this weekend or shortly thereafter.
Page Index Toggle Pages: 1