menu
 
Version
2022.1.18.8567

2024.1.1.8691

2023.1.9.8628

2022.1.18.8567

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
Wwise SDK 2022.1.18
Python (low-level) - HTTP

Initializing the project

infoNote: This example requires Python pip to be installed.

Run the following command from any directory to install dependencies:

# Windows
py -m pip install requests
# macOS, Linux
python3 -m pip install requests

Project Code

Locate the sample file <Wwise installation path>/SDK/samples/WwiseAuthoringAPI/python/low-level/hello-wwise-wamp/main.py.

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

import sys
import os
import requests
import json
import codecs
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../../../include/AK/WwiseAuthoringAPI/py'))
from waapi_uri import WAAPI_URI
payload = {
'uri': WAAPI_URI.ak_wwise_core_getinfo,
'options': {},
'args': {}
}
try:
r = requests.post("http://localhost:8090/waapi", data=json.dumps(payload))
print(r.status_code, r.reason)
print(r.text.encode('utf8', 'replace'))
except:
print("Unable to connect to Waapi: Is Wwise running and Wwise Authoring API enabled?")
info

Note: The line from waapi_uri import WAAPI_URI imports a declaration of the API paths.

It is located in <Wwise installation path>/SDK/include/AK/WwiseAuthoringAPI/py. The location of this file was added to Python's path dynamically by extending sys.path in this sample.

Running the project

Run the sample file from its directory using the following command:

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

If the Wwise Authoring API successfully connects to Wwise, you should see the following output:

(200, 'OK')
{
"platform":"x64",
"displayName":"Wwise",
"branch":"wwise_main",
"copyright":"Š 2006-20??. Audiokinetic Inc. All rights reserved.",
"version":{
"displayName":"v20??.?.?",
"year":20??,"build":????,
"major":?,"schema":??,
"nickname":"",
"minor":0
},
"directories":{
"log":"C:\\Program Files (x86)\\Audiokinetic\\Wwise 20??.?.?\\Authoring\\x64\\Release\\bin\\Logs\\",
"install":"C:\\Program Files (x86)\\Audiokinetic\\Wwise 20??.?.?\\",
"help":"C:\\Program Files (x86)\\Audiokinetic\\Wwise 20??.?.?\\Authoring\\Help\\",
"authoring":"C:\\Program Files (x86)\\Audiokinetic\\Wwise 20??.?.?\\Authoring\\",
"user":"C:\\Users\\(USERNAME)\\AppData\\Roaming\\Audiokinetic\\Wwise\\",
"bin":"C:\\Program Files (x86)\\Audiokinetic\\Wwise 20??.?.?\\Authoring\\x64\\Release\\bin\\"
},
"apiVersion":1,
"isCommandLine":false,
"configuration":"release"
}
infoNote: The information retrieved from Wwise will vary based on your installation.

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