Wwise SDK 2023.1.6
|
Command add-ons allow to define new commands for Wwise Authoring. Each command is associated with an external program that is being triggered by Wwise. Programs that are executed can receive a variety of predefined arguments that are derived from the currently selected objects.
Add-on commands can be triggered in different ways:
Add-on commands can be defined on several levels:
![]() | Note: In case of id conflict, only the first command loaded will be registered. The commands are loaded in the order specified above. |
![]() | Note: Command add-ons specified in the installation folder or in the user data directory are loaded at Wwise startup. Command add-ons specified under the project are loaded at project load time. |
Additionally, every time a command is executed in Wwise, WAAPI will notify the subscribers with ak.wwise.ui.commands.executed, passing the selected objects and honoring WAAPI return options. Add-on commands can be defined with no program to execute, so you could use the publication event to execute your own code in a WAAPI client.
A command is described by the following fields:
The following predefined directories should be used in the program
field to avoid machine-specific absolute paths. They can also be used in the args
field to pass a path as an argument to the program and in the cwd
field to define the current working directory.
Variable | Referenced Location |
---|---|
${CurrentCommandDirectory} | The directory where the current command is defined. As mentioned above, it should be "Add-ons\\Commands". |
${WwiseInstallRoot} | The Wwise installation directory. |
${WwiseInstallBin} | The Wwise.exe directory. |
${WwiseInstallAddons} | Windows: "${WwiseInstallRoot}\\Authoring\\Data\\Add-ons" macOS: "/Library/Application Support/Audiokinetic/Wwise <version>/Authoring/Data/Add-ons/Commands" |
${WwiseUserAddons} | Windows: "%APPDATA%\\Audiokinetic\\Wwise\\Add-ons" macOS: "$HOME/Library/Application Support/Audiokinetic/Wwise/Add-ons/Commands" |
${WwiseProjectRoot} | The Wwise project directory. |
${WwiseProjectAddons} | "${WwiseProjectRoot}\\Add-ons" |
${WwiseProjectOriginals} | "${WwiseProjectRoot}\\Originals" |
${WwiseProjectSoundbanks} | Platform-specific generated soundbanks directory. |
Zero to many variables can be used in the args
field (program arguments). Variables provide a way to access information from the selected objects. For example, you could retrieve an object id and pass it as an argument. Variables also provide a way to access property values from the selected objects, including Custom Properties values. To learn more about Custom Properties, refer to Defining Custom Properties.
For a complete list of possible expressions in variables, refer to the Object Expressions and Value Expressions sections in Wwise Authoring Query Language (WAQL) Reference.
When the selection is multiple, refer to startMode
to learn how these variables are resolved.
Examples:
Variable | Type | Description |
---|---|---|
${id} | string | The object ID (GUID). |
${name} | string | The object name. |
${notes} | string | The object notes. |
${type} | string | The object type. Refer to Wwise Objects Reference for more information on the types available. |
${path} | string | The object path from the project root. Ex: '\\Actor-Mixer Hierarchy\\Default Work Unit\\Sound1' |
${filePath} | string | The path to the file containing the object. The path can be a Work Unit file, or a project file. |
${originalWavFilePath} | string | Absolute path to the original WAV file. Only valid for Sound and Audio Source objects. |
${convertedWemFilePath} | string | Absolute path to the converted WEM file. Specify the platform in the options. Only valid for Sound and Audio Source objects. |
${soundbankBnkFilePath} | string | Absolute path to the generated SoundBank file associated with the SoundBank object. Only valid for SoundBank objects. |
${workunitIsDirty} | boolean | True if a Work Unit or a Project (wproj file) is dirty, meaning it is modified but not saved. |
${Volume} | string | The Voice Volume. |
${OutputBus.name} | string | The Output Bus name. |
To create new commands, create a JSON file under one of the directories listed in Defining Command Add-ons and specify the version to be 2. Please be aware that multiple 3rd parties can create files under these directories. In order to reduce the risk of filename conflicts, we recommend using the following convention for the filenames: companyname_productname.json
Example: mycompany_myproduct.json
The exact same JSON command code as above can be passed to WAAPI ak.wwise.ui.commands.register, to add new commands to the current Wwise process.
Please note that commands added with ak.wwise.ui.commands.register are not persisted. They will remain until the Wwise process terminates. You will have to register them again next time.
Add-on commands can be used to execute WAAPI scripts or programs. This gives you access to Wwise functionalities and project data. Refer to Using the Wwise Authoring API (WAAPI) to learn what you can do with WAAPI.
Add-on commands are executed on Mac using
. Any app, executable or script can be directly specified in program
.
Example: mycompany_myproduct_forMac.json
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageRegister your project and we'll help you get started with no strings attached!
Get started with Wwise