Hello, i try to make some shooter game, and when i was clicking the mouse, the sound gets lags and some noisy, can you help me ? Try it yourself, why it is doing that ? I try to stop afrer if(!audio.isPlaying()) … end its the same… its doesnt matter… why ?
import processing.sound.*;
SoundFile someSoundEffect;
void setup() {
size(800, 800);
someSoundEffect = new SoundFile(this, "http://soundbible.com/mp3/40_smith_wesson_single-mike-koenig.mp3");
// Lets play this sound effect multiple times, doesnt matter if its on the one time or with delays etc.
for (int i = 0; i < 350; i++) {
someSoundEffect.play();
delay(50);
}
}
void draw() {
// Wait some time
delay(1000);
// play again, and you can hear, the audio going very bad...
someSoundEffect.play();
}