# How to install sound library so that I can use properly on raspberry pi 4?

**URL:** <https://discourse.processing.org/t/how-to-install-sound-library-so-that-i-can-use-properly-on-raspberry-pi-4/23028>\
**Category:** Processing for Pi\
**Created:** [August 4, 2020, 9:11am UTC](https://discourse.processing.org/t/how-to-install-sound-library-so-that-i-can-use-properly-on-raspberry-pi-4/23028 "2020-08-04T09:11:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bernd](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bernd](https://discourse.processing.org/u/bernd)\
**Post date:** [August 4, 2020, 9:11am UTC](https://discourse.processing.org/t/how-to-install-sound-library-so-that-i-can-use-properly-on-raspberry-pi-4/23028/1 "2020-08-04T09:11:07Z")

</div>

Hello everybody,

I am new with raspberry pi , trying to use the “basic” sound library on my raspi 4. I don’t want to change to beads or minim (both working, also p5.js works), because the codes are all done and working on windows system with processing.

E.g. when I use the sketch below, there is no error, but also no sound only some choppy noise on the speakers (almost not noticeable). I Installed the library through processing 3.5.3, sound 2.2.3

import processing.sound.\*;  
SoundFile soundfile;

void setup() {  
size(640, 360);  
background(255);  
soundfile = new SoundFile(this, “vibraphon.aiff”);  
println(“SFSampleRate= " + soundfile.sampleRate() + " Hz”);  
println(“SFSamples= " + soundfile.frames() + " samples”);  
println(“SFDuration= " + soundfile.duration() + " seconds”);  
soundfile.loop();  
}

void draw() {  
float playbackSpeed = map(mouseX, 0, width, 0.25, 4.0);  
soundfile.rate(playbackSpeed);  
float amplitude = map(mouseY, 0, width, 0.2, 1.0);  
soundfile.amp(amplitude);  
float panning = map(mouseY, 0, height, -1.0, 1.0);  
soundfile.pan(panning);  
}

I was looking around for two weeks in forums, but couldn’t find anything that helped me. Any suggestions? Does anybody know a reliable way to use soundfile?

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [August 5, 2020, 9:28am UTC](https://discourse.processing.org/t/how-to-install-sound-library-so-that-i-can-use-properly-on-raspberry-pi-4/23028/2 "2020-08-05T09:28:57Z")

</div>

@bernd Could be you’ve not installed pulse-audio, which seems to be required by the sound library. Here’s what you should see when you run `alsamixer` in a terminal. I believe it gets installed by default on ManjaroARM (64 bit), but probably not on RaspberryPI OS (formerly Raspbian).

```auto
Card: PulseAudio F1: Help │
│ Chip: PulseAudio F2: System information │
│ View: F3:[Playback] F4: Capture F5: All F6: Select sound card │
│ Item: Master Esc: Exit   

```

If installed the pulseaudio-volume control looks like this with sketch running:-  
 ![Pulse](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/9a9528348be8c6d643975fc1c02d80388198b35b.png)

---

<div class="post-metadata">

**Author:** ![bernd](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bernd](https://discourse.processing.org/u/bernd)\
**Post date:** [August 5, 2020, 2:03pm UTC](https://discourse.processing.org/t/how-to-install-sound-library-so-that-i-can-use-properly-on-raspberry-pi-4/23028/3 "2020-08-05T14:03:02Z")

</div>

Thank you for this reply, fast as lightning^^. That sounds interesting and I will try it these days, in the meantime in my desperateness I actually changed the code to beads library, it works fine, so I am a bit worried if I install pulseaudio, can it affect the now working system negatively? That is what my alsamixer is telling me, looks like no pulseaudio, I will give it a try later, Thanks anyway!  
 ![Screenshot_20200805_225600](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c7d578038f01d3aa6d3deda0a6b8068144e2ce3a.jpeg) ![Screenshot_20200805_225719](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2fb4c36be297597e294bb035158078df47d2b118.jpeg) ![Screenshot_20200805_225812](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3b060a69d9930103362544a90a92e6864f4f3bfe.jpeg) ![Screenshot_20200805_225916](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/adb9914fc088dfa7d5d9cae9d9ebf1f16a881be7.jpeg)

---

<div class="post-metadata">

**Author:** ![bernd](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bernd](https://discourse.processing.org/u/bernd)\
**Post date:** [August 5, 2020, 2:16pm UTC](https://discourse.processing.org/t/how-to-install-sound-library-so-that-i-can-use-properly-on-raspberry-pi-4/23028/4 "2020-08-05T14:16:46Z")

</div>

By the way, can anybody recommend a reliable pusleaudio installation workflow?  
what I was checking, most of them seem to be pretty tricky?

---

<div class="post-metadata">

**Author:** ![bernd](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bernd](https://discourse.processing.org/u/bernd)\
**Post date:** [August 6, 2020, 5:55am UTC](https://discourse.processing.org/t/how-to-install-sound-library-so-that-i-can-use-properly-on-raspberry-pi-4/23028/5 "2020-08-06T05:55:46Z")

</div>

I installed pulseaudio, also shown in alsamixer, but now there is no sound anymore, maybe a problem with the latest raspian? I will leave it with beads, anyway thanks a lot for your efforts^^
