我想通过AudioUnitAddRenderNotify在当前活动的将音频输出到扬声器的RemoteIO单元上添加一个输出渲染回调。我不能访问实际的RemoteIO实例变量,但我想获得应用程序中的音频单位列表,并通过这种方式找到RemoteIO单位。这有可能吗?
发布于 2013-04-09 19:41:37
如果你能获得访问AUGraph的权限,那么这是可能的。根据AUGraph documentation的说法,有几种方法可以帮助你。
AUGraphGetNodeCount -获取图中的节点数AUGraphGetIndNode -获取索引节点AUGraphNodeInfo -获取节点信息
一旦拥有了正确的节点,您就可以获得remoteIO单元并添加回调函数。获得访问AUGraph的权限实际上才是真正的问题。
发布于 2013-04-03 01:01:51
只有一个RemoteIO。我从来没有尝试过在不是“创建”它的情况下获得一个指向它的指针。你为什么不尝试这样做呢,它应该会给你一个指向RemoteIO的指针:
OSStatus status;
AudioComponentInstance audioUnit;
// Describe audio component
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_RemoteIO;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
// Get component
AudioComponent outputComponent = AudioComponentFindNext(NULL, &desc);
// Get audio units
status = AudioComponentInstanceNew(outputComponent, &audioUnit);
checkStatus(status);https://stackoverflow.com/questions/15427813
复制相似问题