音频单元动态注册 [英] Audio units dynamic registration

查看:87
本文介绍了音频单元动态注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经开发了一个定制的音频单元和音频单元托管应用程序.我们正在尝试从应用程序动态注册自定义音频单元. 下面的代码段用于动态注册音频单元. (此代码段在Apple技术说明TN2247中提到)

We have developed a custom audio unit and audio unit hosting application. We are trying to register the custom audio unit dynamically from the application. Below code snippet is used to register audio unit dynmaically. (this code snippet is mentioned in Apple technical note Technical Note TN2247)

#include <AudioUnit/AudioComponent.h>
extern AudioComponentPlugInInterface*
                MyExampleAUFactoryFunction(const AudioComponentDescription *inDesc);

OSStatus RegisterMyExampleAudioUnit()
{
    //  fill out the version number for the AU
    UInt32 theVersion = 0x00010000;

    //  fill out the AudioComponentDescription
    AudioComponentDescription theDescription;
    theDescription.componentType = kAudioUnitType_Effect;
    theDescription.componentSubType = 'EXAU';
    theDescription.componentManufacturer = 'MYCO';
    theDescription.componentFlagsMask = 0;

    //  Use the flag to indicate that this AudioComponent is Sandbox Safe
    theDescription.componentFlags = kAudioComponentFlag_SandboxSafe;

    //  call AudioComponentRegister()
    return AudioComponentRegister(&theDescription, CFSTR("My Company: MyExampleAU"),
                            theVersion, MyExampleAUFactoryFunction);

在编译音频单元托管应用程序时,我们遇到了链接器错误.

While compiling the audio unit hosting application, we are getting below linker error.

体系结构i386的未定义符号:
从以下位置引用的"_MyExampleAUFactoryFunction":

Undefined symbols for architecture i386:
"_MyExampleAUFactoryFunction", referenced from:

任何人都可以帮助我解决此问题.

Can any one help me solve this issue.

推荐答案

我也遇到了这个问题,我的项目只有C和Objective-C代码. 它有助于创建单个cpp类并将其添加到项目中.我不知道链接器内部更深层次的原因是什么.

I ran into this issue too, my project had only C and Objective-C code. It helped, to create a single cpp class and add it too the project. I do not know what the deeper cause inside the linker is.

这篇关于音频单元动态注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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