'Portaudio install on Raspberry Pi 3B+, linking libraries
I am really having trouble with installing Portaudio on my Raspberry Pi. The issue is that my rpi is not able to play sounds as short as 25 ms (.wav files) well, they are either truncated or they will not play at all. When I play the .wav files by typing in aplay -vv then the sounds play perfectly. I think it has something to do with portaudio as there are some aspects with linking the libraries that I do not fully understand. I am also new to Linux and rpis so I am not fully competent. All this is to run a sound stimulation protocol, as described here: https://github.com/Lx37/PyOpenProto. I think that PyOpenProto and Portaudio are not properly linked which is why PyOpenProto produces truncated sounds when playing the protocol with the wav. files.
To install portaudio, I tried to follow the steps here : http://www.portaudio.com/docs/v19-doxydocs/compile_linux.html:
sudo apt-get install libasound-dev./configure && makesudo make installcp lib/.libs/libportaudio.a /usr/lib/python3.9/site-packages/PyOpenProto-masterAs described, I copied portaudio.h in the project folder (/usr/lib/python3.9/site-packages/PyOpenProto-master). But the following code is something I do not understand:
gcc main.c libportaudio.a -lrt -lm -lasound -ljack -pthread -o YOUR_BINARY
Apparently there must be a main.c file in the portaudio folder, but I cannot find it. Also, I do not know what is meant by YOUR_BINARY, do I need to insert the path of the project folder (../PyOpenProto-master) for YOUR_BINARY?
Just some other information but may be relevant:
I installed all the PyOpenProto-master, portaudio and other sound-related packages all in /usr/lib/python3.9/site-packages.
PyOpenProto-master: /usr/lib/python3.9/site-packages/PyOpenProto-master
Portaudio: /usr/lib/python3.9/site-packages/portaudio-master.
sounddevice 0.4.4: /usr/lib/python3.9/site-packages/sounddevice-0.4.4.dist-info
SoundFile 0.10.3.post1: /usr/lib/python3.9/site-packages/SoundFile-0.10.3.post1.-dist-info
Thank you very much in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
