社区问答

欢迎来到 Audiokinetic 社区问答论坛。在此,Wwise 和 Strata 用户可互帮互助。如需我们团队直接提供协助,请前往技术支持申请单页面。若要报告问题,请在 Audiokinetic Launcher 中选择“报告错误”选项(注意,问答论坛并不会接收错误报告)。我们内部设有专门的错误报告系统,会有专人查看报告并设法解决问题。

要想尽快得到满意的解答,请在提问时注意以下几点:

  • 描述尽量具体:比如,想达到什么样的目的,或者具体哪里有问题。
  • 包含关键细节:比如,Wwise 和游戏引擎版本以及所用操作系统等等。
  • 阐明所做努力:阐明自己为了排除故障都采取了哪些措施。
  • 聚焦问题本身:聚焦于问题本身的相关技术细节,以便别人可以快速找到解决方案。

0 投票
After finally sorting out my projects with my previous linker errors I am getting a new "unresolved external symbol" linker error when trying to use GetIDFromString function in AkSoundEngine.h.  Could anyone help with solving this please?  I am working in a C++ project and I have the integration working fine when using blueprints but seem to still have some troubles in a C++ project.

 

Thanks,

 

Jared
分类:General Discussion | 用户: Jared M. (220 分)

1个回答

+1 投票
 
已采纳
If this code is in a seperate module (that has its own *.build.cs script), you should add the dependency to AkAudio there as well.

Where are you trying to add this code?
用户: Benoit S. (Audiokinetic) (16.0k 分)
采纳于 用户:Jared M.
I am trying to add it to my C++ Game Project.  So for example my project is called MyProject.  In MyProject.build.cs I have the following:

        public MyProject(TargetInfo Target)
    {
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

        PrivateDependencyModuleNames.AddRange(new string[] {  });

                if (UEBuildConfiguration.bCompileAudiokinetic == true)
                {
                    PublicDependencyModuleNames.Add("AkAudio");
                }
        }

Do I need to do more than that?  Inside any of the cpp files in my Game project, if I try to do something like AK:SoundEngine::GetIDFromString("String");  I get the unresolved symbol linker error.

Thanks
That is because your game isn't linking against the Wwise SDK libraries; the AkAudio module (found in the engine) is.

We have wrapped all Wwise SDK functionality in the FAkAudioDevice. Should you want to add some functionality to it, feel free to do so.

For example, you could add GetIDFromString to the FAkAudioDevice (found in UE4\Engine\Source\Runtime\AkAudio\Private\AkAudioDevice.cpp), and then, from your game code, add this:

#include "AkAudioDevice.h"

[...]

FAkAudioDevice* AudioDevice = FAkAudioDevice::Get();
if (AudioDevice)
{
    uint32 WwiseID = AudioDevice->GetIDFromString("MyString");
}

In other words, the FAkAudioDevice is the UE4 wrapper to the AK::SoundEngine workspace. Use this within your game.
Ok great.  The thought had crossed my mind to do that, since I noticed that GetIDFromString is being used in the engine source for AkReverbVolumes but I wasn't sure if that was the "right" way to do it.  Still need to the way UE4 builds its projects and adds in modules and libraries.  Thanks!
...