API

csg_pywaapi functions and use guide

csg_pywaapi.automationMode(enabled)

set automation mode on/off

Parameters:enabled – True or False
Returns:Result struct or False
csg_pywaapi.beginUndoGroup()

Begin an undo group

csg_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

csg_pywaapi.cancelUndoGroup()

Cancel an undo group

csg_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
csg_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
csg_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
csg_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

csg_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

csg_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

csg_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 = csg_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.

csg_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

csg_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
csg_pywaapi.deleteWwiseObject(objectID)

Delete a wwise object

Parameters:objectID – GUID of object to be deleted
Returns:Result structure or False
csg_pywaapi.endUndoGroup(undogroup)

Name and end an undo group

Parameters:undogroup – Name to give the undo group that is ending
csg_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

csg_pywaapi.exit()

Exiting the connection. Also clears automation mode

csg_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

csg_pywaapi.generateSoundbanks(banklist=[])

Generate soundbanks

Parameters:banklist – List of bank names to generate
csg_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

csg_pywaapi.getClient()

Getter for the waapi client connection

csg_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

csg_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

csg_pywaapi.getLanguages()

Get the list of languages from the wwise project

Returns:List of languages
csg_pywaapi.getListOfTypes()

return the list of valid object types, can help debugging

csg_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

csg_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

csg_pywaapi.getOperator(string)

Helper function to convert string comparison to python operator

csg_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
csg_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
csg_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

csg_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
csg_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

csg_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
csg_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

csg_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
csg_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

csg_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

csg_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

csg_pywaapi.saveWwiseProject()

Save the wwise project

csg_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

csg_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

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

csg_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

csg_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

csg_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

csg_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

csg_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

csg_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

Parameters:args – A map of custom arguments for ak.wwise.core.object.create
Returns:The newly created or modified wwise object(s) or False
csg_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()

csg_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
csg_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