捕捉音频输出的Python [英] Capture audio out Python

查看:863
本文介绍了捕捉音频输出的Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从音频输出,使用Python捕获原始数据。在Python文档似乎使用ossaudiodev适用于这一目的。不过,我使用Ubuntu 11.10,它没有为/ dev / DSP:

I would like to capture raw data from the audio out, using Python. In the Python docs it seems that using ossaudiodev works for this purpose. However, I am using Ubuntu 11.10, which has no /dev/dsp:

>>> import ossaudiodev
>>> ossaudiodev.open('r');
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/dev/dsp'

有没有人得到一个线索如何捕捉声音使用Python我的声卡输出?

Has anybody got a clue how to capture the sound my sound card outputs using Python?

推荐答案

OSS是pcated音频系统用于Linux的老年人和德$ P $。本标准为使用ALSA,并与任意一个插孔或ALSA的PulseAudio的顶层。 Ubuntu使用了PulseAudio。

OSS is an older and deprecated audio system for Linux. The current standard is to use ALSA, and to layer on top of ALSA with either JACK or PulseAudio. Ubuntu uses PulseAudio.

你能做的最好的事情是要找到好的Python绑定连接的PulseAudio。我只是做了快速谷歌搜索和你没有发现任何东西,我没有时间跟进更多的现在。

The best thing you could do is to find good Python bindings for connecting to PulseAudio. I just did a quick Google search and didn't find anything for you, and I don't have time to follow up more right now.

编辑:我只记得那ALSA确实有一个OSS兼容模式。您可能能够安装OSS兼容的东西,那么就使用Python code你已经离开。

I just remembered that ALSA does have an OSS compatibility mode. You might be able to install the OSS compatibility stuff, then just use the Python code you already have.

https://help.ubuntu.com/community/alsa-oss

http://www.alsa-project.org/main/index。 PHP / Main_Page

这篇关于捕捉音频输出的Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆