menu
 
버전
2017.1.9.6501

2024.1.5.8803

2023.1.13.8732

2022.1.19.8584

2021.1.14.8108

2019.2.15.7667

2019.1.11.7296

2018.1.11.6987

2017.2.10.6745

2017.1.9.6501

2016.2.6.6153

2015.1.9.5624


menu_open

Using the Wwise Authoring API in Wwise Plug-ins

Calling a remote procedure

The Wwise Authoring API can be used to issue remote procedure calls from within a Wwise plug-in using the AK::Wwise::IAudioPlugin::WaapiCall() method.

info
Note: Calls to the AK::Wwise::IAudioPlugin::WaapiCall() method are always blocking.

Utility classes are provided so that callers can provide a strategy for memory allocation. AK::Wwise::Mallocator offers a default implementation using malloc and free, but a custom one can easily be provided by defining a class that implements AK::IAkPluginMemAlloc. Finally, a wrapper class AK::Wwise::SafeAllocator is used to ensure type-safety and automatic memory management.

Examples:

#include <AK/Tools/Common/AkAllocator.h>
#include <rapidjson/document.h>

// Use the default allocation strategy for results and errors
AK::Wwise::Mallocator alloc;

AK::Wwise::SafeAllocator<char> szResults(&alloc);
AK::Wwise::SafeAllocator<char> szError(&alloc);

// Issue a remote procedure call to the Wwise Authoring API
m_pPSet->WaapiCall("ak.wwise.core.getInfo", NULL, NULL, &alloc, szResults, szError);
if (!szError)
{
    // Parse the results JSON string
    rapidjson::Document results;
    results.Parse(szResults);

    // ...
}
#include <AK/Tools/Common/AkAllocator.h>
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>

// Use the default allocation strategy for results and errors
AK::Wwise::Mallocator alloc;

AK::Wwise::SafeAllocator<char> szResults(&alloc);
AK::Wwise::SafeAllocator<char> szError(&alloc);

// Build a JSON object that contains the procedure's parameters
rapidjson::Document args;
args.SetObject();
args.AddMember("classId", 8192003, args.GetAllocator());
args.AddMember("property", "ModDepth", args.GetAllocator());

// Stringify the JSON object
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
args.Accept(writer);

// Issue a remote procedure call to the Wwise Authoring API
m_pPSet->WaapiCall("ak.wwise.core.plugin.getProperty", buffer.GetString(), NULL, &alloc, szResults, szError);
if (!szError)
{
    // Parse the results JSON string
    rapidjson::Document results;
    results.Parse(szResults);

    // ...
}
info
Note: Here, RapidJSON is only used for demonstration purposes and is in no way mandatory. The library of your choice can be used to manipulate JSON.

Refer to How to Create a Wwise Plug-in DLL for more information on Wwise plug-ins.


이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요