audio - processing, sound overlapping -
i have problems understand how play tracks 1 after other avoiding overlap effect. using minim library did not find way detect final moment of first sound start second one. can give me tips? sketch
import ddf.minim.*; minim minim; audioplayer player[]=new audioplayer[4]; string filenames[] = new string[]{"sound1.mp3", "sound2.mp3"}; void setup(){ minim = new minim(this); for(int i=0;i<2;i++){ player[i] = minim.loadfile(filenames[i]); player[i].play(); print(filenames); } } void draw(){} void stop(){ for(int i=0;i<2;i++){ player[i].close(); } minim.stop(); super.stop(); }
you can poll player[i].isplaying() see if sound still playing before starting next one. in code, means keeping track of player active, , moving call .play() method draw().
Comments
Post a Comment