Audio units dynamic registration

血红的双手。 提交于 2019-12-11 16:49:41

问题


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.

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

Can any one help me solve this issue.


回答1:


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.



来源:https://stackoverflow.com/questions/14705405/audio-units-dynamic-registration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!