# Wav file won't play

**URL:** <https://discourse.processing.org/t/wav-file-wont-play/43283>\
**Category:** Libraries\
**Created:** [November 22, 2023, 7:10pm UTC](https://discourse.processing.org/t/wav-file-wont-play/43283 "2023-11-22T19:10:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vanish87](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@Vanish87](https://discourse.processing.org/u/Vanish87)\
**Post date:** [November 22, 2023, 7:10pm UTC](https://discourse.processing.org/t/wav-file-wont-play/43283/1 "2023-11-22T19:10:00Z")

</div>

Processing suddenly won’t play a wav file that was working fine, here is some data on the matter:

INFO: JSyn: default output latency set to 80 msec for Windows 11  
javax.sound.sampled.LineUnavailableException: line with format PCM\_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.  
at java.desktop/com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:484)  
at java.desktop/com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:115)  
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.start(Unknown Source)  
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)  
java.lang.NullPointerException: Cannot invoke “javax.sound.sampled.TargetDataLine.read(byte, int, int)” because “this.line” is null  
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.read(Unknown Source)  
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.read(Unknown Source)  
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)  
java.lang.RuntimeException: AudioInput stop attempted when no line created.  
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.stop(Unknown Source)  
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)

---

<div class="post-metadata">

**Author:** ![robertesler](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@robertesler](https://discourse.processing.org/u/robertesler)\
**Post date:** [November 23, 2023, 4:58pm UTC](https://discourse.processing.org/t/wav-file-wont-play/43283/2 "2023-11-23T16:58:53Z")

</div>

Hi @Vanish87. That’s odd. Can you provide your audio hardware (especially if its not the built-in hardware), the audio driver for Windows (ASIO, WASAPI, DirectSound, MME, etc.) and the versions of both Processing and the Processing Sound Library? And any code you’re using to play the audio file would be helpful too.  
Usually that error indicates the file is not in a format playable by Java Sound but your format is the most common type so it’s probably not that. It could be an issue with your audio driver allocating resources to another application which Processing (aka Java) is also trying to use.  
Or it could just a be a bug.  
Does this audio file play in other software?  
Thanks.

---

<div class="post-metadata">

**Author:** ![kevinstadler](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@kevinstadler](https://discourse.processing.org/u/kevinstadler)\
**Post date:** [November 27, 2023, 12:30am UTC](https://discourse.processing.org/t/wav-file-wont-play/43283/3 "2023-11-27T00:30:48Z")

</div>

Hello,

hmm this doesn’t look like it’s a problem with the Wav file, but a problem with audio output more generally. Did you make any changes to the sound card setup since you last ran the sketch, or are you running it on a different computer altogether? If you could post the output of `Sound.list();` at the very start of your sketch that would be helpful.

If you are comfortable manually installing a library, you could also try updating to the latest version of the Sound library, which might just fix your issue: [Release v2.4.0-preview · processing/processing-sound · GitHub](https://github.com/processing/processing-sound/releases/tag/v2.4.0-preview)

---

<div class="post-metadata">

**Author:** ![Vanish87](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@Vanish87](https://discourse.processing.org/u/Vanish87)\
**Post date:** [November 28, 2023, 7:21pm UTC](https://discourse.processing.org/t/wav-file-wont-play/43283/5 "2023-11-28T19:21:07Z")

</div>

Hello, I’m back some some data that might prove useful or maybe not:  
\*Update: The soundfile does play on another laptop, albeit not mine.

Realtek(R) Audio Properties  
Driver Date: 5/17/2022  
Driver Version: 6.0.9354.1

Speaker/HP (Realtek(R) Audio) Properties  
Driver Date: 5/6/2022  
Driver Version 10.0.22621.1

Processing 4.3  
Sound 2.3.1

Code:

// Import the sound library  
import processing.sound.\*;

// Declare a SoundFile object  
SoundFile file;

// Load a sound file from the data folder  
file = new SoundFile(this, “Ambient1.wav”);

// Loop the file  
file.loop();

 ![Screenshot 2023-11-28 131338](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/9/7/97895c48ec7e1c17455a70f7c028f12eaab0a95a.jpeg)

---

<div class="post-metadata">

**Author:** ![kevinstadler](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@kevinstadler](https://discourse.processing.org/u/kevinstadler)\
**Post date:** [December 9, 2023, 4:52pm UTC](https://discourse.processing.org/t/wav-file-wont-play/43283/6 "2023-12-09T16:52:20Z")

</div>

That looks like a general issue with the soundcard (probably a 24 bit one?) rather than something about wav playback in particular. The next Sound library release adds reliable 24 bit support on Windows but it will be a while before the update gets rolled out over the Contribution manager – in the meantime I suggest you manually install the upcoming release from the following link, that should fix your problems: [Release v2.4.0-preview · processing/processing-sound · GitHub](https://github.com/processing/processing-sound/releases/tag/v2.4.0-preview)
