Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes

Is there a way to import, say, from a text file, Switches into a Switch Group? Have a fairly long list that typing out could not just be tedious but also human error prone.
Thanks in advance for any thoughts on this.

ago in General Discussion by Kenneth W. (260 points)

1 Answer

+1 vote

Hi Kenneth,

I believe this should be possible using the Wwise Authoring API (WAAPI).

WAAPI allows you to programmatically interact with a Wwise project, and it's an ideal solution for scripting tasks like the one you've described.

In particular, I would recommend using Python for this. You can write a simple script that reads your text file line by line and then makes calls to WAAPI to create the corresponding Switches within the correct Switch Group. The general workflow would be:

1) Read the list of Switches from your text file into a list in your Python script.
2) Connect to Wwise using a WAAPI client.
3) Get the ID of the Switch Group you want to target. You can do this using the function ak.wwise.core.object.get. You would query for your Switch Group by name to retrieve its unique ID.
4) Create the new Switches. You would then loop through your list of names and for each one, call the function ak.wwise.core.object.create. In the arguments for this function, you would specify the name of the new Switch, set the type to 'Switch', and most importantly, provide the ID of the parent Switch Group you retrieved in the previous step.

For further details, you can refer to the official WAAPI documentation here: https://www.audiokinetic.com/en/library/2024.1.5_8803/?source=sdk&id=waapi.html

ago by Alessandro Famà (2.3k points)
...