问题描述
我正在从事一个涉及从树莓派上录制麦克风的项目。
现在我在程序运行时收到此错误。
I am working on a project that involves recording from a mic on a raspberry pi.for now i am getting this error while the program is running.
,我发现文件pa_linux_alsa.c属于端口音频。请参考以下链接。
while searching for ways to fix this, i figured out the file pa_linux_alsa.c belongs to port audio. please refer to the following links.
第一个链接是关于错误和已修改的修复程序,仍然不知道在哪里复制以及最后两个关于安装portaudio。显然,没有什么简单的方法可以通过命令来安装它。
first link is about the error and a modified fix, still dont know where to copy and the last two are about installing portaudio. apparently there is no easier way to install this with a command.
我下载了pa_snapshot的增强版。 但是我不知道我应该把这些文件放在哪里开始按照自述文件进行配置和制作。我将portaudio目录复制到 home / pi (我认为是用户。 cd 并复制到那里),然后按照自述文件进行操作,然后重新启动了系统。我看不到程序错误的任何变化。我尝试对pa_ linux_alsa.c 使用命令 whereis 。该命令也不会显示文件或与portaudio相关的任何内容。
i downloaded the pa_snapshot enhanced version of it. but i dont know where i am supposed to put these files to begin to configure and make as in the readme. I copied the portaudio directory in to home/pi (in the user i think. "cd" and copied it there) then did as in the readme and rebooted the system. i dont see any changes in the error in program. i tried using the command whereis with pa_linux_alsa.c. that command also doesn't show the file or anything related to portaudio.
推荐答案
您的第一个链接可以正确识别portaudio中的错误,但修复不完整。我分叉了portaudio库,并创建了一个补丁来解决此问题。以下是删除portaudio软件包并从源代码编译修补版本的步骤:
Your first link correctly identifies a bug in portaudio, but the fix is incomplete. I forked the portaudio library and created a patch to fix this. Here are the steps to remove the portaudio package and compile the patched version from source:
sudo apt-get remove libportaudio2
sudo apt-get install libasound2-dev
git clone -b alsapatch https://github.com/gglockner/portaudio
cd portaudio
./configure && make
sudo make install
sudo ldconfig
cd ..
此时,您应该有一个基于pa_stable_v190600_20161030标记的修补后的portaudio库。最后,如果您需要用于Python的PyAudio软件包,请使用pip安装它: sudo pip3 install pyaudio
。
At this point, you should have a patched portaudio library, based on the pa_stable_v190600_20161030 tag. Finally, if you need the PyAudio package for Python, then install it using pip: sudo pip3 install pyaudio
.
这篇关于如何在pi上正确安装portaudio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!