I want to play a sound file controlled by a number. I have written this simplified code:-
import ddf.minim.*;
Minim minim;
AudioPlayer [] player= new AudioPlayer[5];
void setup()
{
size(512, 200);
minim = new Minim(this);
player[0] = minim.loadFile("1.wav");
player[1] = minim.loadFile("1.wav");
player[2] = minim.loadFile("1.wav");
player[3] = minim.loadFile("1.wav");
player[4] = minim.loadFile("1.wav");
}
void draw()
{ }
So I am loading in the same file five times. Four times it works fine but the fifth gives an error message:- ==== JavaSound Minim Error ==== ==== Unable to return a SourceDataLine: unsupported format - PCM_SIGNED 44100.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian
=== Minim Error ===
=== Couldn't load the file 1.wav
It is the same file so how can the format be wrong? I am using a Raspberry Pi, and four files ( different ones ) will play fine but when I extend it to 5 or above it fails. Is their another way to do what I want?
Thanks