音频单元主机需要做什么才能使用非Apple音频单元? [英] What does an Audio Unit Host need to do to make use of non-Apple Audio Units?

查看:66
本文介绍了音频单元主机需要做什么才能使用非Apple音频单元?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个需要托管音频单元的Objective-C ++框架.如果我尝试使用Apple的默认装置(如DLS Synth)和各种效果,则一切工作都很好.但是,我的应用程序似乎无法找到任何第三方音频单元(在/Library/Audio/Plug-Ins/Components中).

I am writing an Objective-C++ framework which needs to host Audio Units. Everything works perfectly fine if I attempt to make use of Apple's default units like the DLS Synth and various effects. However, my application seems to be unable to find any third-party Audio Units (in /Library/Audio/Plug-Ins/Components).

例如,以下代码段...

For example, the following code snippet...

CAComponentDescription tInstrumentDesc = 
     CAComponentDescription('aumu','dls ','appl');

AUGraphAddNode(mGraph, &tInstrumentDesc, &mInstrumentNode);

AUGraphOpen(mGraph);

...工作正常.但是,如果我改用'aumu', 'NiMa', '-Ni-'(本机的Massive Synth的说明)初始化tInstrumentDesc,则AUGraphOpen()将返回OSStatus错误badComponentType,并且AUGraph无法打开.这适用于我所有的第三方音频单元.

...works just fine. However, if I instead initialize tInstrumentDesc with 'aumu', 'NiMa', '-Ni-' (the description for Native Instruments' Massive Synth), then AUGraphOpen() will return the OSStatus error badComponentType and the AUGraph will fail to open. This holds true for all of my third party Audio Units.

下面的代码是从Audacity来源修改而来的,可以使您对该问题有所了解.它将遍历特定类型的所有可用音频单元,并打印出它们的名称.

The following code, modified from the Audacity source, sheds a little light on the problem. It loops through all of the available Audio Units of a certain type and prints out their name.

ComponentDescription d;

d.componentType = 'aumu';
d.componentSubType = 0;
d.componentManufacturer = 0;
d.componentFlags = 0;
d.componentFlagsMask = 0;

Component c = FindNextComponent(NULL, &d);
while(c != NULL)
{
    ComponentDescription found;

    Handle nameHandle = NewHandle(0);

    GetComponentInfo(c, &found, nameHandle, 0, 0);

    printf((*nameHandle)+1);
    printf("\n");

    c = FindNextComponent(c, &d);
}

运行此代码后,唯一的输出是Apple: DLSMusicDevice(这是符合上面描述'aumu', 'dls ', 'appl'的音频单元).

After running this code, the only output is Apple: DLSMusicDevice (which is the Audio Unit fitting the description 'aumu', 'dls ', 'appl' above).

这似乎不是单位本身的问题,因为Apple的auval工具列出了我的第三方单位(他们也进行了验证).

This doesn't seem to be a problem with the units themselves, as Apple's auval tool lists my third party Units (they validate too).

我尝试使用sudo运行测试应用程序,而我正在使用的自定义框架位于/Library/Frameworks中.

I've tried running my test application with sudo, and the custom framework I'm working on is in /Library/Frameworks.

推荐答案

事实证明,问题出在64位编译中.切换到32位后,一切开始按广告中的说明工作.我想解决方案不多,但您有.

Turns out, the issue was due to compiling for 64-bit. After switching to 32-bit, everything began to work as advertised. Not much of a solution I guess, but there you have it.

为澄清起见,我的意思是将XCode Build Setting ARCHS更改为"32位Intel",而不是默认的标准32/64位Intel".

To clarify, I mean changing the XCode Build Setting ARCHS to "32-bit Intel" as opposed to the default "Standard 32/64-bit Intel".

这篇关于音频单元主机需要做什么才能使用非Apple音频单元?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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