Description
WaapiCS is a C# abstraction layer (or “wrapper”) for Audiokinetic Wwise’s WAAPI. It is intended to make WAAPI tremendously easier to use in C# by removing the difficulties of WAMP and JSON from the end user.
WaapiCS is made available to you under the MIT License. This means it is free, open source, customizable, and available for commercial use/distribution.
The only legal requirement is that you provide attribution (give me credit) in your game.
Please note that WaapiCS is still under active development. Known issues (such as calls not working) can be found under the “Issues” tab on GitHub.
Make WAAPI Easier
The main barrier of entry to Audiokinetic’s Wwise Authoring API (WAAPI) interface for relative newcomers to programming is that it’s difficult to learn to use.
WaapiCS aims to fix this – removing the need to learn complicated looking WAMP (Web Application Messaging Protocol) code and JSON packets. Instead, WaapiCS uses an extremely similar syntax to WAAPI itself, but only requires the user to understand how basic C# functions and arguments work.
This sample code from Audiokinetic is all required to run a single command – ak.wwise.core.getInfo
public static void CallGetInfo(IWampRealmProxy realmProxy)
{
Console.WriteLine("Calling 'ak.wwise.core.getInfo'");
// Arguments are passed using keywordArguments with primitive values which are serialized as Json
IDictionary<string, object> keywordArguments = new Dictionary<string, object>();
realmProxy.RpcCatalog.Invoke(
new AssertCallback(),
new CallOptions(),
"ak.wwise.core.getInfo",
new object[] { }, // Voluntarily empty, we use only keywordArguments
keywordArguments);
}
public class AssertCallback : IWampRawRpcOperationClientCallback
{
public void Result<TMessage>(IWampFormatter<TMessage> formatter, ResultDetails details, TMessage[] arguments, IDictionary<string, TMessage> argumentsKeywords)
{
string name = argumentsKeywords["displayName"].ToString();
string copyright = formatter.Deserialize<JToken>(argumentsKeywords["version"])["displayName"].ToString();
Console.WriteLine("ak.wwise.core.getInfo: Hello {0} {1}", name, copyright);
}
// Other method overloads are never used: WAAPI always sends keyword arguments
public void Error<TMessage>(IWampFormatter<TMessage> formatter, TMessage details, string error, TMessage[] arguments, TMessage argumentsKeywords) {}
public void Error<TMessage>(IWampFormatter<TMessage> formatter, TMessage details, string error) {}
public void Error<TMessage>(IWampFormatter<TMessage> formatter, TMessage details, string error, TMessage[] arguments) {}
public void Result<TMessage>(IWampFormatter<TMessage> formatter, ResultDetails details) {}
public void Result<TMessage>(IWampFormatter<TMessage> formatter, ResultDetails details, TMessage[] arguments) {}
}
Using WaapiCS, all of the previous code becomes one single line:
Dictionary<string, object> results = ak.wwise.core.GetInfo();
With very little knowledge of full-fledged C#, you can now take advantage of the power of Audiokinetic’s WAAPI.
Multiple Layers
WaapiCS is built on two separate layers – a user-facing layer, and a “communication” layer that talks directly with Wwise itself.
Every game is built differently, and thus has different needs – there’s no way that one single framework can become everything your game might need in order to take advantage of Waapi.
Due to WaapiCS being built in two layers, your programmers, implementers, and technical sound designers can customize WaapiCS’s user-facing layer and still avoid having to deal with WAMP and JSON. If your programmers wish to build a different interface for your team, you can with very little complication!
Free, Open Source, Commercial Use
WaapiCS is available for free, is open source, and available for commercial use under the MIT License. This means any and every game project can use it without any legal complications. All that is required is attribution.
Get Custom Tools
If your team is looking for custom tools built for Wwise with WAAPI or WaapiCS – get in touch with me immediately.
Copyright 2016-2021, NIR LLC, all rights reserved.