# Problems with Sound Library in Android

**URL:** <https://discourse.processing.org/t/problems-with-sound-library-in-android/44973>\
**Category:** Processing for Android\
**Created:** [August 22, 2024, 9:15am UTC](https://discourse.processing.org/t/problems-with-sound-library-in-android/44973 "2024-08-22T09:15:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MPROCD](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@MPROCD](https://discourse.processing.org/u/MPROCD)\
**Post date:** [August 22, 2024, 9:15am UTC](https://discourse.processing.org/t/problems-with-sound-library-in-android/44973/1 "2024-08-22T09:15:48Z")

</div>

I have a sketch working perfectly under Processing/Java.  
When I switch to Android, I get a number of notifications (see below) and the sketch does not run.  
The sketch runs OK if I remove the Sound related rows (Same rows running OK under Java).  
Any ideas on how to proceed?

Thanks

Android compiler Notifications:  
UnixTime: 1724317491482  
Thu Aug 22 12:04:51 IDT 2024  
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(JavaSoundAudioDevice.java:273)  
at com.jsyn.engine.SynthesisEngine$EngineThread.run(SynthesisEngine.java:309)  
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(JavaSoundAudioDevice.java:300)  
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.read(JavaSoundAudioDevice.java:291)  
at com.jsyn.engine.SynthesisEngine$EngineThread.run(SynthesisEngine.java:330)  
java.lang.RuntimeException: AudioInput stop attempted when no line created.  
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.stop(JavaSoundAudioDevice.java:318)  
at com.jsyn.engine.SynthesisEngine$EngineThread.run(SynthesisEngine.java:357)

---

<div class="post-metadata">

**Author:** ![MPROCD](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@MPROCD](https://discourse.processing.org/u/MPROCD)\
**Post date:** [August 29, 2024, 9:31am UTC](https://discourse.processing.org/t/problems-with-sound-library-in-android/44973/2 "2024-08-29T09:31:32Z")

</div>

Hello  
Problem solved: I removed the existing Sound library and downloaded the last version of Processing-Sound from github. and now the sketch runs correctly.

---

<div class="post-metadata">

**Author:** ![jasmine119](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jasmine119](https://discourse.processing.org/u/jasmine119)\
**Post date:** [December 19, 2024, 2:46pm UTC](https://discourse.processing.org/t/problems-with-sound-library-in-android/44973/3 "2024-12-19T14:46:11Z")

</div>

Hi everyone,

I’m a new member here, and I recently encountered a similar issue with the Sound library when trying to run sketches on Android. After some troubleshooting, I followed a similar solution to MPROCD’s suggestion by downloading the latest version of the Processing-Sound library from GitHub[.](https://przestronnie.pl/)

However, while this fixed the main issue, it seems to have introduced a new one. The sketch runs now, but I’m noticing [briefly describe the new problem here, if possible].

Has anyone else experienced something similar? I’d appreciate any guidance or tips. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ProcessingOrg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/processingorg/32/18341_2.png) [@ProcessingOrg](https://discourse.processing.org/u/ProcessingOrg)\
**Post date:** [December 19, 2024, 2:48pm UTC](https://discourse.processing.org/t/problems-with-sound-library-in-android/44973/4 "2024-12-19T14:48:05Z")

</div>

> However, while this fixed the main issue, it seems to have introduced a new one. The sketch runs now, but I’m noticing [briefly describe the new problem here, if possible].

Hello @jasmine119! It seems like you might have meant to describe the issue you’re encountering but posted before including the details. When you have a moment, feel free to share more about the new problem, and the community will be happy to help! 😊
