# Hello all I have problem with a sound

**URL:** https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492
**Category:** Libraries
**Created:** [September 12, 2018, 6:13pm UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492 "2018-09-12T18:13:00Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![cupko24](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@cupko24](https://discourse.processing.org/u/cupko24)
#### Post date: [September 12, 2018, 6:13pm UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492/1 "2018-09-12T18:13:00Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![kjhollen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kjhollen/32/23_2.png) [@kjhollen](https://discourse.processing.org/u/kjhollen)
#### Post date: [September 12, 2018, 7:41pm UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492/2 "2018-09-12T19:41:33Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![cupko24](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@cupko24](https://discourse.processing.org/u/cupko24)
#### Post date: [September 12, 2018, 8:45pm UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492/3 "2018-09-12T20:45:58Z")

</div>

Hi @kjhollen , this is the part of the code

```auto
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

---

<div class="post-metadata">

### Author: ![kjhollen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kjhollen/32/23_2.png) [@kjhollen](https://discourse.processing.org/u/kjhollen)
#### Post date: [September 12, 2018, 10:15pm UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492/4 "2018-09-12T22:15:19Z")

</div>

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. 🙂

---

<div class="post-metadata">

### Author: ![SlyZ](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SlyZ](https://discourse.processing.org/u/SlyZ)
#### Post date: [November 18, 2018, 3:26pm UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492/5 "2018-11-18T15:26:19Z")

</div>

```auto
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](http://www.softsynth.com), rate = 44100, RT, V16.8.0 (build 463, 2017-10-16)

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [November 24, 2018, 8:17pm UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492/6 "2018-11-24T20:17:35Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![earp123](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/earp123/32/8916_2.png) [@earp123](https://discourse.processing.org/u/earp123)
#### Post date: [April 21, 2020, 5:16am UTC](https://discourse.processing.org/t/hello-all-i-have-problem-with-a-sound/3492/7 "2020-04-21T05:16:27Z")

</div>

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
