Waapi GDNative interface - alessandrofama/wwise-godot-integration GitHub Wiki

Methods

Return value Signature
bool connect_client(String uri, unsigned int port)
bool is_client_connected()
void disconnect_client()
Dictionary subscribe(String uri, String options)
Dictionary subscribe_with_timeout(String uri, String options, int timeoutMs)
Dictionary unsubscribe(int subscriptionId)
Dictionary unsubscribe_with_timeout(int subscriptionId, int timeoutMs)
Dictionary client_call(String uri, String args, String options)
Dictionary client_call_with_timeout(String uri, String args, String options, int timeoutMs)
String get_last_string()

Method descriptions

  • bool connect_client(String uri, unsigned int port)

Connects the Waapi client at the given uri and port. The Wwise authoring application should be open and available at the given location and port in order for this call to succeed. Example:

var connectResult = Waapi.connect_client("127.0.0.1", 8080)

if connectResult:
   # Do something...

Returns true if connection succeeded.


  • bool is_client_connected()

Checks the connection status of the Waapi client.

Returns true if the client is connected, false otherwise.


  • void disconnect_client()

Disconnects the Waapi client from the current Wwise authoring session.


  • Dictionary subscribe(String uri, String options)

Subscribes the Waapi client to changes to e.g. the Wwise project in the authoring app. In order to get the data dictionary with keys subscriptionID and jsonString, the signal wamp_event should be connected in GDScripts, e.g.

Waapi.connect("wamp_event", self, "_on_wamp_event")

func _on_wamp_event(data):
   print(data)

Returns a Dictionary with keys subscriptionId, subscribeResult and resultString


  • Dictionary subscribe_with_timeout(String uri, String options, int timeoutMs)

Subscribes the Waapi client to changes to e.g. the Wwise project in the authoring app and returns after some timeout in milliseconds has passed. Works similarly to subscribe but adding a timeout.

Returns a Dictionary with keys subscriptionId, subscribeResult and resultString


  • Dictionary unsubscribe(int subscriptionId)

Unsubscribes the Waapi client to changes to e.g. the Wwise project in the authoring app, given a subscription ID.

Returns a Dictionary with keys unsubscribeResult, resultString


  • Dictionary unsubscribe_with_timeout(int unsubscriptionId, int timeoutMs)

Unsubscribes the Waapi client to changes to e.g. the Wwise project in the authoring app with a timeout in milliseconds. Works similarly to unsubscribe but adding a timeout.

Returns a Dictionary with keys unsubscribeResult, resultString


  • Dictionary client_call(const String uri, const String args, const String options)

Calls the Waapi with a given uri, arguments and options. Example of usage:

var connectResult = Waapi.connect_client("127.0.0.1", 8080)

if connectResult:	
   var args = {"from": {"ofType": ["Project", "Bus", "Switch", "State", "Event", "SoundBank"]}}
   var options = {"return": ["name", "type", "workunit", "path", "shortId"]}
	
   var clientCallDict = Waapi.client_call("ak.wwise.core.object.get", JSON.print(args), JSON.print(options))
   var jsonProjectDocument = JSON.parse(clientCallDict["resultString"])

   if jsonProjectDocument.error == OK and jsonProjectDocument.result.has("return"):
      print(jsonProjectDocument.result["return"])

if Waapi.is_client_connected():
   Waapi.disconnect_client()

Returns a Dictionary with keys callResult, resultString


  • Dictionary client_call_with_timeout(String uri, String args, String options, int timeoutMs)

Calls the Waapi with a given uri, arguments and options, specifying a time out in milliseconds.

Returns a Dictionary with keys callResult, resultString


  • String get_last_string()

Gets the last string result from subscribe, unsubscribe or call. Useful for debugging.

Returns a result String