Linux-在没有硬件声卡的情况下,捕获音频回放并将其记录到文件中 [英] Linux - Without hardware soundcard, capture audio playback, and record it to file
问题描述
这样的事情有可能吗?
是否可以创建虚拟声卡,然后使用例如PyAudio监听其输出并将其保存到文件中?注意机器上没有硬件声卡.
Is there a possibility to create a virtual sound card and then use for example PyAudio to listen to its output and save it to a file? NOTE that there is no hardware soundcard present on the machine.
我尝试了很多事情,尤其是 snd-dummy
ALSA模块,但是我开始怀疑我是否在寻找合适的工具.如果有人能指出我至少是高级解决方案,我将不胜感激.最好是可以在Ubuntu服务器上运行的东西.
I have tried a lot of things, especially snd-dummy
ALSA module, but I am starting to doubt if I am looking for the right tools. I would be grateful if someone could point me towards at least high-level solution. Preferably something that would work on Ubuntu server.
推荐答案
由于@mjy和@Matthias的帮助,我终于设法找出了使录音工作所需的最少步骤:
Thanks to both @mjy and @Matthias I have finally managed to figure out the minimal steps to take in order to make the recording work:
sudo apt-get install pulseaudio jackd2 alsa-utils dbus-x11
无需使用 snd-dummy
,无需创建任何其他配置文件...所有这些仅使我损失了几个小时:(在干净的Ubuntu上安装了这些软件包之后服务器安装后,我能够运行Python脚本并使用PyAudio将输出音频捕获到文件中.
No need to play with snd-dummy
, no need to create any additional config files... All these things only caused me to lose few hours :( After installing these packages on a clean Ubuntu server installation, I was able to run Python script and capture output audio to a file using PyAudio...
这篇关于Linux-在没有硬件声卡的情况下,捕获音频回放并将其记录到文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!