API
csg_pywaapi functions and use guide
- pss_pywaapi.WAQLsearchForObject(searchterm, returnProperties=[])
Perform a search using WAQL, return additional properties for each object. For more info on options see Wwise SDK for ak.wwise.core.object.get https://www.audiokinetic.com/library/edge/?source=SDK&id=ak_wwise_core_object_get.html
- Parameters:
searchterm – WAQL formatted string
returnProperties – Additional properties to return for each object
- Returns:
Result structure or False
- pss_pywaapi.automationMode(enabled)
set automation mode on/off
- Parameters:
enabled – True or False
- Returns:
Result struct or False
- pss_pywaapi.beginUndoGroup()
Begin an undo group
- pss_pywaapi.call(procedure, arguments)
Support manually calling a waapi procedure with custom arguments
- Parameters:
procedure – The name of the waapi procedure to call
arguments – The argument map to pass to procedure
- Returns:
Result structure or False
- pss_pywaapi.cancelUndoGroup()
Cancel an undo group
- pss_pywaapi.checkWwiseVersionIsAtLeast(year=2019, major=0, minor=0, build=0)
Check the wwise version is at least equal to the version required For version info see https://www.audiokinetic.com/en/library/edge/?source=SDK&id=ak_wwise_core_getinfo.html :param year: The year element of the wwise version :param major: The major element of the wwise version :param minor: The minor element of the wwise version :param build: The build element of the wwise version :return: True if the wwise version is equal or greater than the input, otherwise False
- pss_pywaapi.checkoutWorkUnit(workunitID)
Source control operation to check out work unit
- Parameters:
workunitID – GUID of the work unit to checkout
- Returns:
Result structure or False
- pss_pywaapi.cleanfilePathFromWwise(path)
Cleans the undesired characters from Mac paths that Wwise gives you. E.g. replaces Y: with ~
- Parameters:
path – path to clean (e.g. wproj or work unit path)
- Returns:
os.path formated path, cleaned of Mac/WINE characters
- pss_pywaapi.connect(port=None)
Connect to Wwise authoring api , on the port provided. If port is left empty, we try to read the port set in the user preferences settings file. If port is empty and the user settings file cannot be read, default port to use is 8080 This sets up the client used for all future calls in the same session, so should be called before any other functions
- Parameters:
port – The waapi port to use (default is 8080 if not provided, and user settings cannot be read)
- Returns:
wwise connection info structure OR False
- pss_pywaapi.copyWwiseObject(objectID, parent, conflict='replace')
copy object to new location under parent
- Parameters:
objectID – ID of wwise object to copy
parent – ID of the parent to paste object under
conflict – Behaviour for conflicting objects (default = replace)
- Returns:
Result structure or False
- pss_pywaapi.createControlInputStructForNewModulator(type='ModulatorTime', name='New Modulator', AdditionalKeyValueProperties={})
Helper function to create a ControlInputStruct for use with setCreateRTPCCurveForObject() See ak.wwise.core.object.set in wwise docs
- Parameters:
type – The type of modulator to be created. Possible values: ModulatorLfo, ModulatorEnvelope, ModulatorTime,GameParameter,MidiParameter
name – The name of the modulator to be created
AdditionalKeyValueProperties – A dictionary of additional control properties to set for a modulator e.g. for ModulatorTime this might be: {“@TimeModDuration”: 5,”@EnvelopeStopPlayback”: false}
- Returns:
The newly created or modified wwise object(s) or False
- pss_pywaapi.createEventForObject(objectID, EventParent, action='Play', eventName='', conflictmode='merge')
Create an event targeting a given object, with overloaded arguments for event name and action.
- Parameters:
objectID – The GUID of the object to be targeted by the event
EventParent – A GUID or path of an object to be the parent of the new event. If a path which doesnt exist it will be created
action – Named argument. The action type of the event. Defaults to Play
eventName – Named argument. The name of the event. If not provided, the event will be named based on the action + object name
conflictmode – Named argument. What to do in the event of a name conflict
- Returns:
The newly created wwise object(s) or False
- pss_pywaapi.createStructureFromPath(path, parent)
Create a structure of objects from a string path and return the last object in the path. If the path already exists, no new objects are created, and the existing last object in the path is returned.
- Parameters:
path – String path of the structure to be created. Objects should be seperated by double backslash (\\\\) and type should prefix name in angle brackets <> e.g <WorkUnit>MyWorkUnit
parent – ID or path of the parent object to create the structure under e.g. \\\\Actor-Mixer Hierarchy
- Returns:
The last descendent object in the path created
e.g. res = pss_pywaapi.createStructureFromPath(“<WorkUnit>Hello\\\\<Folder>World”, “\\\\Actor-Mixer Hierarchy”)
If no types are provided, and elements of the path do not exist already, then default types will be used. Default types are first Folder then WorkUnit. If a Folder cannot be created at the given location (usually because there is no work unit in the path), then a Work Unit will be created.
- pss_pywaapi.createWwiseObject(parentID, otype='BlendContainer', oname='', conflict='merge')
Create a wwise object of type otype, called oname, underneath
- Parameters:
parentID – The GUID of the parent object
otype – The type of wwise object to create
oname – The name to give the new object
conflict – Behaviour for conflicting objects (default=merge)
- Returns:
The newly created wwise object structure or False
- pss_pywaapi.createWwiseObjectFromArgs(args={})
Create a wwise object from a custom argument structure. Useful if you need to create many complex objects.
- Parameters:
args – A map of custom arguments for ak.wwise.core.object.create
- Returns:
The newly created wwise object(s) or False
- pss_pywaapi.deleteWwiseObject(objectID)
Delete a wwise object
- Parameters:
objectID – GUID of object to be deleted
- Returns:
Result structure or False
- pss_pywaapi.endUndoGroup(undogroup)
Name and end an undo group
- Parameters:
undogroup – Name to give the undo group that is ending
- pss_pywaapi.executeCommand(command, objects=[])
wrapper to execute UI commands See https://www.audiokinetic.com/library/2017.1.9_6501/?source=SDK&id=globalcommandsids.html
- Parameters:
command – Command to execute
objects – List of objects to pass to the command
- Returns:
Result structure or False
- pss_pywaapi.exit()
Exiting the connection. Also clears automation mode
- pss_pywaapi.filterWwiseObjects(objects, property, operation, value, NOT=0)
helper function to filter a list of objects by a specific property, value and comparison operation # e.g. return only objects with “@Volume” , “<” , “-48”
- Parameters:
objects – List of wwise objects to filter
property – Which property to filter by
operation – String comparison operator for filter. One of; “==”,”<”,”<=”,”>”,”>=”,”!=”,”contains”
- Returns:
List of objects matching filters
- pss_pywaapi.generateSoundbanks(banklist=[])
Generate soundbanks
- Parameters:
banklist – List of bank names to generate
- pss_pywaapi.getAllObjectsOfType(ofType, returnProperties=[])
Get all objects of a certain type, and return any extra properties
- Parameters:
ofType – Type of wwise objects to search for
returnProperties – Additional return properties to get for each object
- Returns:
Result structure or False
- pss_pywaapi.getClient()
Getter for the waapi client connection
- pss_pywaapi.getDescendantObjects(objectID, returnProperties=[], tfrom='id', select='descendants')
Perform a search fromObject to find all descendants, return additional properties for each object. Optionally change the from and select parts of the query, by default use ID as the object
- Parameters:
objectID – Starting point of search.
returnProperties – Additional properties to return for each object
tfrom – Key that determines how fromObject is used in the search (default=id)
select – Key that determines which objects are searched in relation to the fromObject (default=descendants)
- Returns:
Result structure or False
for more info on options see Wwise SDK for ak.wwise.core.object.get https://www.audiokinetic.com/library/edge/?source=SDK&id=ak_wwise_core_object_get.html
- pss_pywaapi.getDescendantObjectsOfType(objectID, ofType, returnProperties=[], tfrom='id', select='descendants')
Perform a search fromObject to find descendants ofType, return additional properties for each object. Optionally change the from and select parts of the query, by default use ID as the object for more info on options see Wwise SDK for ak.wwise.core.object.get https://www.audiokinetic.com/library/edge/?source=SDK&id=ak_wwise_core_object_get.html
- Parameters:
objectID – Starting point of search. Default is a GUID
ofType – Type of wwise objects to search for
returnProperties – Additional properties to return for each object
tfrom – Key that determines how fromObject is used in the search (default=id)
select – Key that determines which objects are searched in relation to the fromObject (default=descendants)
- Returns:
Result structure or False
- pss_pywaapi.getLanguages()
Get the list of languages from the wwise project
- Returns:
List of languages
- pss_pywaapi.getListOfTypes()
return the list of valid object types, can help debugging
- pss_pywaapi.getObjectProperties(objectID, returnProperties=[], tfrom='id')
Get some additional properties from a wwise Object, by default use ID as the object
- Parameters:
objectID – Wwise object to get properties from. Default is a GUID
returnProperties – Additional properties to return for each object
tfrom – Key that determines how fromObject is used in the search (default=id)
- Returns:
Result structure or False
for more info on options see Wwise SDK for ak.wwise.core.object.get https://www.audiokinetic.com/library/edge/?source=SDK&id=ak_wwise_core_object_get.html
- pss_pywaapi.getObjectsByName(name, type, returnProperties=[], tfrom='ofType')
Perform a search by name, return additional properties for each object. Named search must also include a type filter. For more info on options see Wwise SDK for ak.wwise.core.object.get https://www.audiokinetic.com/library/edge/?source=SDK&id=ak_wwise_core_object_get.html
- Parameters:
name – String to match with object names
type – Type of wwise objects to search for
returnProperties – Additional properties to return for each object
tfrom – Key that determines how fromObject is used in the search (default=ofType)
- Returns:
Result structure or False
- pss_pywaapi.getOperator(string)
Helper function to convert string comparison to python operator
- pss_pywaapi.getPathToWwiseProjectFolder()
Gets a path to the root folder of wwise project, cleans any nonsense from Mac paths.
- Returns:
os.path formated path to the wwise folder on disk
- pss_pywaapi.getProjectInfo(additionalProperties=[])
Get the wwise project info by default returns filePath, @DefaultLanguage
- Parameters:
additionalProperties – List of additional properties to return from the project (optional)
- Returns:
Results structure or False
- pss_pywaapi.getPropertyAndReferenceNamesForObject(ObjIDorPath=None, classid=None)
Retrieves the list of property and reference names for an object.
- Parameters:
ObjIDorPath – The ID (GUID), name, or path of the object
classid – The class ID to use instead of a specific object
- Returns:
The names of properties and references for the object type
- pss_pywaapi.getRTPCCurvesForObject(ObjIDOrPath)
Get the RTPC curves for an object See https://www.audiokinetic.com/en/library/edge/?source=SDK&id=wwiseobject_rtpc.html Only supported in Wwise 2022 and higher
- Parameters:
ObjIDOrPath – The ID or path of the object
- Returns:
The list of RTPC curve structs for the input object
- pss_pywaapi.getReferencesToObject(objectID, returnProperties=[], tfrom='id')
get the references to a given object, by default use ID as the object
- Parameters:
fromObject – Wwise object to get references to. Default is a GUID
returnProperties – Additional properties to return for each object
tfrom – Key that determines how fromObject is used in the search (default=id)
- Returns:
Results structure or False
- pss_pywaapi.getSelectedObjects(properties=[])
Get the currently selected object(s), returning any extra properties. By default objects will return [“id”,”type”, “name”, “path”] + properties[]
- Parameters:
properties – list of additional properties to be returned for the wwise objects.
- Returns:
Result structure or False
- pss_pywaapi.getSoundbanks(objectID, tfrom='id')
Return all Soundbanks referencing any object of the Work Unit directly
- Parameters:
objectID – The object GUID to use in the search
tfrom – Key that determines how obj is used in the search (default=id)
- Returns:
List of banks directly referencing obj
- pss_pywaapi.getWwiseUserSettingByName(Name='')
Get a named setting from the various .wsettings files wwise generates. Wsetting files contain setting dictionaries that look like this……… DefaultOutputBus Name=’SFX’ ID=’{DA827D60-6AFF-47BB-AB1B-BD786FCFD3E6}’…or…. Property Name=’WaapiWampPort’ Type=’int32’ Value=’8095’.
- Parameters:
Name – Name of the setting to retrieve
- Returns:
Dictionary of Key Value pairs relating to the requested setting, or None if not found
- pss_pywaapi.getWwiseUserSetting_WAMPport()
Get the WAMP port saved in the user setting file for the authoring tool
- pss_pywaapi.getWwiseVersion()
Get the Wwise Version struct
- pss_pywaapi.importAudioFiles(args)
Import audio files with custom args
- Parameters:
args – A map of custom arguments for ak.wwise.core.audio.import
- Returns:
Result structure or False
- pss_pywaapi.importAudioFilesBatched(args, size=100)
Import audio files with custom args. Splits large import jobs into batches of size (waapi has issues parsing large import jobs)
- Parameters:
args – A map of custom arguments for ak.wwise.core.audio.import
size – size of the batches to import (defaults to 100)
- Returns:
Result structure or False
- pss_pywaapi.isStringValidID(string)
Check if a given string is formatted as a valid ID, using regex fullmatch with pattern - ^{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}}$
- Parameters:
string – The string to match against the regex ID pattern
- Returns:
True if string matches the pattern of a wwise ID, otherwise False
- pss_pywaapi.moveWwiseObject(objectID, parent, conflict='replace')
move object to new location under parent
- Parameters:
objectID – ID of wwise object to move
parent – ID of the parent to move object under
conflict – Behaviour for conflicting objects (default = replace)
- Returns:
Result structure or False
- pss_pywaapi.pasteObjectProperties(source=None, targets=[], pasteMode='replaceEntire', inclusion=[], exclusion=[])
Pastes properties, references and lists from one object to any number of target objects. See https://www.audiokinetic.com/en/library/edge/?source=SDK&id=ak_wwise_core_object_pasteproperties.html Only supported in Wwise 2022 and higher
- Parameters:
source – The ID, name, or path of the source object.
targets – A list of the target objects (The ID, name, or path of the target object)
pasteMode – Paste mode for lists. Default value is “replaceEntire”. With “replaceEntire” all elements in the lists of a target object are removed and all selected elements from the source’s lists are copied.
inclusion – Array of properties, references and lists to include in the paste operation. When not specified, all properties, references and lists are included, and the exclusion defines which ones to exclude
exclusion – Array of properties, references and lists to exclude from the paste operation. When not specified, no properties, references and lists are excluded.
- Returns:
The result structure or False
- pss_pywaapi.removeSwitchContainerAssignment(switch, child)
Remove a given child object from a given switch (switch container)
- Parameters:
switch – Name of the switch to assign child to
child – ID of the wwise object to assign to switch
- Returns:
Result structure or False
- pss_pywaapi.renameWwiseObject(objectID, newName)
Rename a given object with newName
- Parameters:
objectID – ID of wwise object to rename
newName – The new name of the wwise object
- Returns:
Result structure or False
- pss_pywaapi.saveWwiseProject()
Save the wwise project
- pss_pywaapi.searchForObject(searchterm, returnProperties=[], tfrom='search')
Perform a search by name, return additional properties for each object. For more info on options see Wwise SDK for ak.wwise.core.object.get https://www.audiokinetic.com/library/edge/?source=SDK&id=ak_wwise_core_object_get.html
- Parameters:
searchterm – String to search for
returnProperties – Additional properties to return for each object
tfrom – Type of search to do, defaults to “search” can be overridden to use path
- Returns:
Result structure or False
- pss_pywaapi.setCreateRTPCCurveForObject(ObjIDOrPath, PropertyName, ControlInputStructOrID=None, PointsList=None)
Set or create an RTPC curve on an object See ak.wwise.core.object.set in wwise docs Only supported in Wwise 2022 and higher
- Parameters:
ObjIDOrPath – The ID or path of the object which will have the new RTPC curve
PropertyName – The name of the property to be controlled (e.g. OutputBusVolume)
ControlInputStructOrID – A struct defining the control input. Either can be the ID of an existing RTPC curve, or a struct creating a new modulator, filled by createControlInputStructForNewModulator()
PointsList – List of points for the new curve, in the format [{ “x”: 100.0, “y”: -20.82785, “shape”: “Linear” },{ “x”: 10000.0, “y”: 21.8509, “shape”: “Linear” }]
- Returns:
The newly created or modified wwise object(s) or False
- pss_pywaapi.setNotes(objectID, value)
Set the notes of object to value
- Parameters:
objectID – GUID of the object
value – String to set as notes
- Returns:
Result structure or False
- pss_pywaapi.setProperty(objectID, property, value, platform=None)
Set a property of a wwise object
- Parameters:
objectID – GUID of the object
property – Name of the property to set
value – The value to set for given property
platform – Optional. The platform to apply the property for
- Returns:
Result structure or False
- pss_pywaapi.setPropertyPerPlatform(object, property, value, platform)
Set a property of a wwise object
- Parameters:
object – GUID of the object
property – Name of the property to set
value – The value to set for given property
platform – The platform to apply this property to
- Returns:
Result structure or False
- pss_pywaapi.setReference(objectID, reference, value, platform=None)
Set a reference of a wwise object
- Parameters:
objectID – GUID of the object
reference – Name of the reference to set
value – The value to set for given property
platform – Optional. The platform to apply the reference for
- Returns:
Result structure or False
- pss_pywaapi.setSwitchContainerAssignment(switch, child)
Assign a given child object to a given switch (switch container)
- Parameters:
switch – Name of the switch to assign child to
child – ID of the wwise object to assign to switch
- Returns:
Result structure or False
- pss_pywaapi.setWwiseObjectWithArgs(args={})
Set or create wwises object from a custom argument structure. Useful if you need to create many complex objects. See ak.wwise.core.object.set in wwise docs Only supported in Wwise 2022 and higher
- Parameters:
args – A map of custom arguments for ak.wwise.core.object.create
- Returns:
The newly created or modified wwise object(s) or False
- pss_pywaapi.setupImportArgs(parentID, fileList, originalsPath, language='SFX')
Helper function to construct args for import operation
- Parameters:
parentID – GUID of the parent object
fileList – List of audio files to import
originalsPath – Relative location to put new files inside Originals
language – Import audio as SFX (default) or a given language
- Returns:
An arguments structure ready to be passed into importAudioFiles()
- pss_pywaapi.setupSubscription(subscription, target, returnArgs=['id', 'name', 'path'])
Subscribe to an event. Define a target to call when triggered, get the retunArgs back
- Parameters:
subscription – Waapi subscription topic
target – The function to run on the callback trigger
returnArgs – Properties to return with the callback
- pss_pywaapi.showObjectsInListView(objects=[])
Open the provided list of objects in the Wwise List View
- Parameters:
objects – A List of object IDs, paths or type qualified names
- Returns:
Result structure or False