Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
814 views
in Technique[技术] by (71.8m points)

ubuntu server - Linux - Without hardware soundcard, capture audio playback, and record it to file

Is such a thing even possible?

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...