Mac OS X的虚拟音频驱动程序 [英] Mac OS X virtual audio driver

查看:5909
本文介绍了Mac OS X的虚拟音频驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个虚拟的音频设备,从默认的输出获取音频数据(这是一个输出IOAudioStream),并将其转换为一个输入IOAudioStream。

I want to create a virtual audio device that gets audio data from the default output (which is an output IOAudioStream) and converts it to an input IOAudioStream.

我完成大部分的例子我能找到了,但他们只实现一个功能,输出IOAudioStream顶多复制到输入之一。这意味着,如果音频设备被选择作为输出它仅变换音频到的输入流。

I went through most of the examples I could find, however they only implement a feature to copy the output IOAudioStream to the input one at most. That means it only converts the audio to an input stream if the audio device is selected as output.

这应该是可能的,因为ScreenFlow允许计算机音频记录通过安装创建一个虚拟驱动器的内核扩展。

This should be possible, since ScreenFlow allows recording of computer audio by installing a kext that creates a virtual driver.

如何从默认的输出访问音频数据并将其发送到我的虚拟驱动程序?

How can I access the audio data from the default output and send it to my virtual driver?

推荐答案

看看开源 WavTap ,该是开源 SoundFlower 虚拟声卡驱动程序的简化叉。这是我相信.kext确实大幅你想要的东西。

Take a look at the open-source WavTap, which is a simplified fork of the open-source SoundFlower virtual sound card driver. It is a .kext that I believe does substantially what you want.

有关参考,这里是一些流行的商业封闭源代码的选项是如何工作的:结果
盗贼变形虫的音频劫持专业版 的结果
通过code - 捕获音频系统基于该开源SoundFlower .kext结果的
启动应用程序时,结果被替换为正常CoreAudio.framework一个补丁框架 - 捕获应用程序的声音
- 捕获一个已经运行的应用程序与haxie应用程序增强器(APE)从Unsanity的帮助音频搜索

For reference, here is how some popular commercial closed-source options work:
Rogue Amoeba's Audio Hijack Pro
-Captures system audio via code based off of the open-source SoundFlower .kext
-Captures an application's audio by substituting a "patch" framework for the normal CoreAudio.framework when launching the application
-Captures an already-running application's audio with the help of the haxie "Application Enhancer" (APE) from Unsanity

这些功能的品牌作为他们的即时接通功能(InstantOn.kext)。

These features are branded as their "Instant On" feature (InstantOn.kext).

豚草软件的窃听工作室 的结果
通过内部系统 - 捕获音频和应用的音频.kext

Ambrosia Software's WireTap Studio
-Captures system audio and application audio via an in-house developed .kext

Telestream的的 ScreenFlow 的结果
通过内部的 - 捕获系统的音频开发.kext。(2.x版使用varaudio .kext;版本3.x使用TelestreamAudio.kext)

Telestream's ScreenFlow
-Captures system audio via an in-house developed .kext. (Version 2.x uses varaudio.kext; Version 3.x uses TelestreamAudio.kext)

Macsome的录音机 的结果
侠名方法

Macsome's Audio Recorder
-Unknown method

Araelium集团的 Screenflick 的结果
使用SoundFlower .kext - 捕获系统音频

Araelium Group's Screenflick
-Captures system audio using the SoundFlower .kext

更新#1 结果
看完笔者的意见后,它出现的根本目标是为了能够捕捉到的系统声音的没有的发布虚拟音频驱动程序作为设备(即会出现在系统preference的列表),并的改变当前缺省输出装置(或至少外观设备已改变)。

UPDATE #1
After reading the author's comments, it appears the underlying goal is to be able to capture the system sound without publishing the virtual audio driver as a device (that would appear in the System Preference's list) and without changing the current default output device (or at least the appearance that the device has changed).

SoundFlower:的安装时添加搜索声音设备到列表
WavTap:的添加声音设备安装在名单;自动选择时WavTap应用程序启动器;自动取消选择设备时,应用程序关闭和重新选择previous装置化工
音频劫持临:的增加​​仅在选择默认的系统声音的音频采集声音设备;删除在音频采集不再被选中的声音设备,并重新选择previous装置化工
窃听工作室:的未知结果
ScreenFlow:的捕获系统声音不改变当前默认输出设备并没有发布虚拟音频驱动程序作为设备

SoundFlower: Adds a sound device to the list upon installation
WavTap: Adds a sound device to the list upon installation; auto-selects the device when the WavTap application is started; auto-deselects the device when the application is shutdown and reselects the previous device
Audio Hijack Pro: Adds a sound device only when audio capture of the default system sound is selected; removes the sound device when audio capture is no longer selected and reselects the previous device
WireTap Studio: Unknown
ScreenFlow: Captures the system sound without changing the current default output device and without publishing the virtual audio driver as a device

更新#2 结果
从杰夫·摩尔,一个苹果CoreAudio的工程师,报价在提到应用,如窃听和音频劫持临:结果
有系统会给你任何具体的应用程序或整个组合将硬件的输出上没有的API ... [采集系统声音]不受系统支持,那些人必须是聪明的。没有什么东西做同样的事情阻止你,除了你怎么舍得让你的手脏。
事实是,Mac OS X的音频系统的设计,首先对性能。这促使我们设计它是不容易支持你想要的功能,而不对性能产生不利。所以,我们选择了在不能够提供该功能的更好表现。

如果您想了解更多关于这个问题,检查出CoreAudio的API邮件列表上这些线程:结果
窃听,CoreAudio的的API和系统捕获和kext文件...结果
于捕捉音频的另一个问题回放通过软件结果
捕获使用CoreAudio的Mac上当前播放的音频结果
'音频劫持'结果
监控系统的音频输出线像水龙头结果
捕获音频输出到文件结果
镜像音频输出结果
记录系统的音频结果

If you want to read more on the subject, check out these threads on the CoreAudio API mailing list:
"WireTap, CoreAudio's API, and system capture, and kexts..."
"Another question on capturing audio played back by a software"
"Capturing currently played audio using CoreAudio on Mac"
"'audio hijack'"
"monitoring system audio output like wire tap"
"Capturing audio output to a file"
"Mirroring Audio Output"
"Recording system audio"

相关SO问题:结果
使用隐藏的音频设备codeless KEXT 结果

Relevant SO Questions:
Hide Audio device using codeless kext

所以长话短说,你可能不会发现苹果是做到这一点的例子,你可能不会发现开源$ C ​​$ C,要么实现此,除非有人是感情的非常的大手笔。这似乎是太宝贵的信息。

So long story short, you're not likely to find examples from Apple that accomplish this, and you're not likely to find open source code that accomplishes this either, unless someone is feeling very generous. It appears to be too valuable of information.

这篇关于Mac OS X的虚拟音频驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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