捕获的Mac OS X系统的音频输出与Python [英] Capturing Mac OS X System Audio output with Python

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

问题描述

我一直在尝试使用劫持的Mac OS X系统的音频 PyAudio 并保存到Python中的WAV。也就是说,我不想记录从输入装置如麦克风。我想从任何或所有应用程序抢声音输出。

I've been trying to "hijack" the Mac OS X system audio using PyAudio and save to a wav in python. That is, I do not want to record from an input device such as a microphone. I want to grab the sound output from any or all applications.

我按照在PyAudio网站上的教程,但这些似乎并没有掩盖我的使用情况,当我尝试从输出流中读取我意料之中得到paCanNotReadFromAnOutputOnlyStream例外。很公平!有没有办法做我的PyAudio或其他建议源码Python库?

I have followed the tutorials on the PyAudio site but these do not appear to cover my use case and when I try to read from the output stream I unsurprisingly get the paCanNotReadFromAnOutputOnlyStream exception. Fair enough! Is there a way to do what I am proposing with the PyAudio or other FOSS Python Library?

推荐答案

我发现,称为开源项目 SoundFlower 让我迅速地,我需要的地方。

I found that an open-source project called SoundFlower got me quickly to the place I needed to be.


  1. 我安装谷歌从code中的SoundFlower包。

  2. 打开系统preferences - >声音

  3. 之所以选择Soundflower作为输出设备

  4. 之所以选择Soundflower作为我的输入设备

当时我能够录制使用PyAudio默认设​​备系统的音频。无声音从扬声器/耳机在这种情况下,虽然。我不知道是否可以使用杰克OS X路由音频输出SoundFlower到系统的音频输出。

I was then able to record system audio from the default device using PyAudio. No sound comes from the speakers/headphones in this situation though. I wonder if you could use Jack OS X to route audio out of SoundFlower to the system audio out.

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

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