Sound Library error when playing sound files

When I use the Sound library I consistently get this error when playing a sound file “ERROR:/synth/map/input : Audio input index 0 out of range for synth 2.” I will hear some sound, but certainly parts of the sound are dropping. Is there any work around? Should I switch to Minim when playing sound files in a program?

This is some example code:

import processing.video.*;
Movie movie;
//sound library comes after movie library
import processing.sound.*;
SoundFile song;
Amplitude amp;


void setup(){
fullScreen();
background(0);
movie = new Movie(this, "84.mov");
movie.loop();
song = new SoundFile(this,"STE-017.wav");
song.loop();
amp = new Amplitude(this);
amp.input(song);
}

void movieEvent(Movie m) {
  m.read();
}

void draw(){
 fill(0);
 imageMode(CENTER);
 rect(0,0,width,height);
float msize = map(amp.analyze(),0,.6,.7,1.7);
image(movie, width/2, height/2, width * msize, height * msize);
 
}

The Sound Library has been archived—it’s not in current development. We’re currently working to re-write it from scratch to have the same API, but a different audio engine. I do recommend working with Minim at this moment.

1 Like

Here’s a link to the current Sound library development: Early builds of the new Processing Sound library available for testing

1 Like