Version
menu_open
Attention : vous avez été redirigé vers la plus récente documentation correspondant à votre version générale ( 2018.1.11.6987 ). Si vous souhaitez accéder à la documentation de votre version précise, veuillez télécharger la documentation hors ligne depuis l'Audiokinetic Launcher et sélectionner l'option de documentation Offline dans l'application de création Wwise.
Wwise SDK 2018.1.11
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.

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 <rapidjson/document.h>
// Use the default allocation strategy for results and errors
AK::Wwise::SafeAllocator<char> szResults(&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 <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
// Use the default allocation strategy for results and errors
AK::Wwise::SafeAllocator<char> szResults(&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);
// ...
}
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.


Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise