Hi,
I am quite new to processing and this error has pop up
" expecting RCURLY, found 'else' ". What does this mean? and how can I solve the problem?
I have an audio playing and when the mouse is pressed random sound trigger. When the sound trigger the audio is paused but I can't get the audio to play again once it is paused, i.e. it goes silence.
This is my script:
import ddf.minim.*;
import ddf.minim.AudioSample.*;
Minim minim;
AudioPlayer tone;
AudioSample [] sounds = new AudioSample [3];
void setup()
{
size(100, 100);
minim = new Minim(this);
tone = minim.loadFile("backgroundsound.wav");
tone.loop();
sounds [0] = minim.loadSample("do.wav");
sounds [1] = minim.loadSample("re.wav");
sounds [2] = minim.loadSample("me.wav");
}
void draw() {}
void mousePressed() {
if ( mousePressed) {
tone.pause();
else {
tone.play();
int index = int( random(0,10) );
sounds[index].trigger();
}
}
void stop() {
tone.close();
minim.stop();
super.stop();
}
Would love to hear some feedback. Thanks.
1