Hello all I have problem with a sound

I got this report, and the sound after every click is lagging more and more.

sep 12, 2018 8:09:41 PM com.jsyn.devices.javasound.JavaSoundAudioDevice
INFO: JSyn: default output latency set to 80 msec for Windows 7
sep 12, 2018 8:09:41 PM com.jsyn.engine.SynthesisEngine start
INFO: Pure Java JSyn from softsynth, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)

thank you for repsponse.

Hi @cupko24, can you please provide a short example of the code you’re running that produces this error? And, what operating system are you using? Thanks!

Hi @kjhollen , this is the part of the code

import processing.sound.*;
  
  SoundFile file;
  String audioName = "tank shot.wav";
  String path;

void setup() {
size(800,500);
  background(#3A3762);
      fill(#483E2A);   
  rect(BACKX,BACKY,Height,Width);
}

void draw(){
 if (keyPressed == true ){
    file = new SoundFile(this, "tank shot.wav");
    file.play();
     }
}

other things in the code are not necessary so i cutted this out, to make sense. I just started universitz and we had to make anz animation, so I decided to make a tank which is shooting with sound.

error or report is this “sep 12, 2018 10:45:39 PM com.jsyn.devices.javasound.JavaSoundAudioDevice
INFO: JSyn: default output latency set to 80 msec for Windows 7
sep 12, 2018 10:45:39 PM com.jsyn.engine.SynthesisEngine start
INFO: Pure Java JSyn from softsynth, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)”

Thanks

1 Like

Got it. One thing I notice is that the code is loading/re-reading the sound file many times when a key is pressed because file = new SoundFile(this, "tank shot.wav"); is in draw. You’ll want to move this to setup so it’s only loaded once at the beginning of your sketch. You can just keep the part that plays the sound in draw–you might need a few other adjustments to get it to sound right, but I’ll let you work through that. :slight_smile:

1 Like
import processing.sound.*;
SoundFile file3;

void setup(){
 size(1280,720);
 background(10,15,10);

 file3 = new SoundFile(this, "Jaunter -  Reset.mp3");
}

void draw(){
 file3.play();
}

Can you help me plz I don’t understand

nov. 18, 2018 4:15:26 PM com.jsyn.engine.SynthesisEngine start
INFOS: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)

@Slyz I believe that this is just an information message from JSyn – not an error. Are you having problems with the sketch otherwise?

If you have a question on a different sketch then you may want to post your own topic.

I am also getting this INFO message but was wondering how I might reduce this latency? I imagine I might have to get into the JSyn driver but not sure what I’d have to modify.

Thanks for your time