Loading...
Logo
Processing Forum
rilans's Profile
1 Posts
0 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    Hey guys,

    I'm fairly new to Processing, and I have been trying to get an AudioSample working using the Minim Library. I have been getting the buffer underrun error message, and more problematically, a very strange buzzing noise on the Audio. It can still be played, but I've had no success in getting it to sound normal. I've tried a few different pieces of code- even this one I re-jigged from one of the samples. It might also be important to note that I'm working on a Mac (OSX)

    import ddf.minim.*;
     
    Minim minim;
    AudioSample song;
     
    void setup()
    {
      size(512, 200, P3D);
      minim = new Minim(this);
      // load BD.wav from the data folder
      song = minim.loadSample("song1.mp3", 2048);
      if ( song == null ) println("Didn't get song!");
    }
     
    void draw()
    {
      background(0);
      stroke(255);
      // use the mix buffer to draw the waveforms.
    }
     
    void keyPressed()
    {
      if ( key == 's' ) song.trigger();
    }
     
    void stop()
    {
      // always close Minim audio classes when you are done with them
      song.close();
      minim.stop();
     
      super.stop();
    }

    I've had a look at all the Processing resources I could get my hands on, but no answers so far. Any suggestions would be really appreciated.