Version

menu_open
Warning: you were redirected to the latest documentation corresponding to your major release ( 2023.1.9.8628 ). Should you wish to access your specific version's documentation, please download the offline documentation from the Audiokinetic Launcher and check the Offline Documentation option in Wwise Authoring.
Wwise SDK 2023.1.9
Python (Waapi-Client) - Remote Procedure Call

Initializing the project

Note: The Python Waapi-Client is intended for use with Python 3.7+.

Run the following command from any directory to install dependencies:

# Windows
py -3 -m pip install waapi-client
# macOS, Linux
python3 -m pip install waapi-client

Project Code

This file contains the following code, which allows you to connect to the Wwise Authoring API.

#!/usr/bin/env python3
from waapi import WaapiClient, CannotConnectToWaapiException
from pprint import pprint
try:
# Connecting to Waapi using default URL
with WaapiClient() as client:
# NOTE: client will automatically disconnect at the end of the scope
# == Simple RPC without argument
print("Getting Wwise instance information:")
result = client.call("ak.wwise.core.getInfo")
pprint(result)
# == RPC with arguments
print("Query the Default Work Unit information:")
object_get_args = {
"from": {
"path": ["\\Actor-Mixer Hierarchy\\Default Work Unit"]
},
"options": {
"return": ["id", "name", "type"]
}
}
result = client.call("ak.wwise.core.object.get", object_get_args)
pprint(result)
except CannotConnectToWaapiException:
print("Could not connect to Waapi: Is Wwise running and Wwise Authoring API enabled?")

Running the project

With a project open in Wwise, run the script in a terminal with the following command:

# Windows
py rpc.py
# macOS, Linux
python3 rpc.py

You should observe in the output something like:

Getting Wwise instance information:
[Wwise Information Dictionary dump]
Query the Default Work Unit information:
{'return': [{'id': '{CDF62889-48AA-436C-B7DD-5B6B1DF5050D}',
'name': 'Default Work Unit',
'type': 'WorkUnit'}]}

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise