Version

menu_open
Wwise SDK 2023.1.2
Wwise Authoring API Examples Index

Refer to Using the Wwise Authoring API (WAAPI) for more information about Wwise Authoring API.

Examples

Adding a Custom Cue to an existing Music Segment
Creates a Custom Cue inside an existing Music Segment with the specified name and time in milliseconds.

Adding a Marker to an Audio Source
In the "Markers" list of an audio source, appends a Marker using the given Time and Label properties.

Adding a State Group to a Sound
Adds a State Group to a Sound.

Adding a message to the logs
Adds a message to the logs on channel 'general'.

Adding a new files to source control.
Add two new audio files to the SFX directory and the source control.

Adding a warning to the SoundBank Generation channel
Adds a warning to the logs on channel 'soundbankGenerate'.

Adding an RTPC with curve to an object
In the "RTPC" list of an object creates an RTPC on a property, using the given ControlInput and curve points.

Adding an RTPC with curve to an object and creates a new Custom ControlInput
In the "RTPC" list of an object, creates an RTPC on a property using the given ControlInput and curve points.

Adding an object to the inclusion list
Adds an object to the SoundBank's inclusion list. The 'media' filter is left out.

Assigning a Switch Container's child to a State
Equivalent to dragging a child of a Switch Group to a State listed in the Assigned Objects view.

Beginning an undo group
Begins an undo group.

Bringing the currently connected Wwise to foreground
Brings the currently connected Wwise to the foreground.

Canceling an undo group
Cancels an undo group.

Changing the playlist of a Random Sequence object
The playlist added to the Random Sequence object is composed of the '1st number' object followed by two times '2nd Number'.

Checking if a property is enabled
Checks if a property is enabled.

Clear an attenuation reference
Clears the attenuation reference on the specified object by setting a null GUID.

Clearing the general log.
Clears the entire log on the channel 'general'.

Clearing the inclusion list
The SoundBank's inclusion list is cleared via the 'replace' operation and an empty 'inclusions' list.

Closing the current project
Closes the current project.

Closing the current project
Closes the current project.

Commiting a file modification in the source control.
The modification and the message on it is sent to the source file.

Connecting to Cube
Connects to a game named Cube on the same computer.

Connecting to a profile
Connects to a saved profile (.prof file) via a specified full path.

Convert External Sources for a platform
Convert External Sources for Linux at the default output path.

Convert External Sources for several platforms and output paths
Convert External Sources for several platforms given a variety of wsources files, with optional and default output paths.

Copying an object to the given parent
Copies the object specified by the "object" ID and makes that copy a child of "parent". The object is renamed if "parent" already contains a child with the same name.

Create a Music Playlist Container with segment and playlist
Creates a new Music Playlist Container, import a wav file in a Music Segment and create a playlist.

Create a Sound with Source Plug-in
Creates a new Sound with a Synth One Source Plug-in.

Creating a Play Event on a Sound
Creates an event called 'Play_SFX' under the virtual folder 'WAAPI', with Play action on the SFX sound object. Refer to Action for the list of possible event properties and action types.

Creating a Random Container with two Sound objects
Creates a Random Container called 'Boom' under the specified parent, with two Sound objects 'A' and 'B'.

Creating a Sound object
Creates a new Sound object called 'Boom' under the specified parent.

Creating a Virtual Folder
Creates a new virtual folder called 'Guns' under the default work unit. If a folder with the same name already exists, it automatically finds a unique name.

Creating a music hierarchy
In one operation, create a Music Switch Container, a Music Playlist Container, a Music Segment, and a Music Track with one imported WAV file.

Creating a new SFX with no file and setting a value to a property
Creates a new SFX under "objectPath", setting its volume attribute to 1.

Creating a new project
Creates the .wproj project specified by path.

Creating a new project
Creates the .wproj project specified by path.

Creating a new project for Android platform
Creates the .wproj project specified by path.

Creating a new project for Windows and Android platforms
Creates the .wproj project specified by path.

Creating a transport object
Creates a transport object for a given Wwise object.

Creating an Actor-Mixer
Creates a new virtual folder called 'Guns' under the default work unit. If a folder with the same name already exists, it automatically finds a unique name.

Creating multiple child hierarchies of objects in batch
In one operation, create child hierarchies under multiple objects: #1. Creates a new Sound object called 'Boom' under the specified parent, #2. Creates a new virtual folder called 'Guns' under the default work unit. If a folder with the same name already exists, it automatically finds a unique name, #3. Creates an event called 'Play_SFX' under the virtual folder 'WAAPI', with Play action on the SFX sound object, #4. Creates a Random Container called 'Boom' under the specified parent, with two Sound objects 'A' and 'B', #5. Creates a Custom Cue inside an existing Music Segment with the specified name and time in milliseconds. See the examples for ak.wwise.core.object.create to compare the two schemas.

Creating new Source Plug-ins for a Voice
Creates two new Source objects for a Voice using plug-in Silence and SoundSeed Grain for the languages "English(US)" and "French".

Defining an attenuation curve of an object
Defines the "object"'s attenuation curve for "curveType" by setting a series of "points".

Deleting a new file to source control.
Remove an existing file to the SFX directory and the source control.

Deleting an object by GUID
Deletes the object specified by GUID.

Deleting an object by path
Deletes the MyTone object specified by its path.

Destroying a transport object
Destroys the given transport object.

Disabling profiler data
Disable "Voices Data"

Disconnecting from a game
Disconnects from the currently connected game or process.

Enabling profiler data required for ak.wwise.core.profiler.getVoiceContributions
Enable "Voices Data" and "Voice Inspector Data" using the default value (true) for the enable property

Enabling the profiler data
Enable "Voices Data"

Ending an undo group
Ends an undo group.

Executing a command not requiring the object's parameter
Executes the "ResetAllMutes" command.

Executing a command requiring the object's parameter
Executes "ConvertCurrentPlatform" on objects defined by "objects" GUID's.

Finding and selecting objects in Project Explorer
Finds the specified objects in the Project Explorer view (Selection Channel 1), and selects them.

Generating a new SoundBank by specifying inclusions
Sample call that import a new SoundBank and then generate it, the SoundBank will not be saved in the project. Refer to ak.wwise.core.soundbank.generated to learn how to retrieve the SoundBank data.

Generating a new SoundBank on disk by specifying inclusions
Import a new SoundBank, generate it and then write it to disk in the SoundBank generation folder.

Generating a short sine tone WAV file
Generates a 1 second mono WAV file that contains a sine waveform, with a very short attack and release.

Generating several existing SoundBanks without writing them to disk
Generating SoundBanks already in project and have the bank data streamed via WAAPI. Refer to ak.wwise.core.soundbank.generated to learn how to retrieve the SoundBank data.

Get the state of a State Group.
Gets the current state of the PlayerHealth State Group by GUID

Get the state of a switch for a Game Object.
Gets the state of the Surface Switch Group for Game Object Footstep.

Gets information for a Curve
Uses the "points" accessor to get the curve's points.

Gets information for an RTPC
Uses the property/reference accessor @ to get the "PropertyName" property and the "ControlInput" and "Curve" references of an RTPC.

Gets the RTPC ids from a sound's "RTPC" list
Uses the list accessor @ to reference the "RTPC" list. Note that RTPCs are unnamed.

Getting a transport object's State
Gets the State of the given transport object.

Getting all Conversion Plug-ins
Using a WAQL query in order to retrieve all Conversion Plug-ins.

Getting all objects containing a sound object
Retrieves the id of objects with at least one child being a sound object. Duplicates are filtered out using the "distinct" transform.

Getting all platforms
Retrieves the platform ids and names.

Getting an attenuation curve of an object
Gets the "curve" from an object specified by "object"

Getting an object's name
Returns the object's name property.

Getting available consoles
Gets the available console for the connected sound engine.

Getting information about Wwise
Gets information about the currently connected Wwise.

Getting peaks across channels
Get peaks for an audio source object.

Getting peaks across channels
Gets peaks for an audio source object (within the trimmed region).

Getting peaks per channel
Get peaks for an audio source object.

Getting peaks per channel
Gets peaks for an audio source object (within the trimmed region).

Getting the active source of a sound object
Uses the "activeSource" accessor to get the sound's active source.

Getting the assignments of a Switch Container
Gets the list of assignments for a Switch Container.

Getting the connection status
Retrieves the current connection status. In this example, Wwise is connected to the Integration Demo.

Getting the descendant objects matching a filter
From all the descendants in the Actor-Mixer Hierarchy, return the objects whose names start with 'My'. This uses the regular expression '^My'.

Getting the information about the current Project
Gets information about the current opened project.

Getting the list of all object types
Retrieves the list of all object types.

Getting the objects using an effect
Uses the referencesTo and owner accessors to get the list of objects using the effect ShareSet.

Getting the output bus being used
Returns the inherited output bus. It uses the override parent values to determine the source of override.

Getting the project name, path, and dirty state
Retrieves the project name, file path, and dirty state. Note that the project name is defined in the WPROJ MXL, and may not match the filename. For using WAAPI on Mac, please refer to Using WAAPI on Mac .

Getting the properties and references of an object
Returns the voice volume and the output bus of an object.

Getting the selected object
Retrieves the GUID of the selected object

Getting the source controle status for a file.
Returns the source control status and owner of the file.

Getting the volume of an object
Returns the volume of the Master Audio Bus.

Import SoundBank Definitions from file.
Imports the SoundBank Definitions from the specified text files.

Importing Base64 content to create a Sound SFX object
Creates a Source SFX object and an audio file source object and imports the specified base64 content as a WAV file.

Importing WAV files into Impacter source plug-in
Creates a Sound and an Impacter source plug-in, then imports WAV files.

Importing a MIDI file into a Music Segment to create a Music Track
Creates a Music Segment from the imported MIDI file. A Music Track and a Music Clip are also created.

Importing a WAV file into Soundseed Grain source plug-in
Creates a Sound and a Soundseed Grain source plug-in, then imports a WAV file.

Importing a WAV file into a Convolution Reverb effect plug-in
Creates a Sound and a Convolution Reverb effect plug-in, then imports a WAV file as an impulse response.

Importing a WAV file into a Music Track to create a Music Clip
Creates a Music Segment, a Music Track, and imports its WAV file. A Music Track is also created.

Importing a WAV file into a Sound Voice
Creates a Sound Voice object and an audio file source object and imports its wave file for English localization.

Importing a WAV file into a new Sound SFX and creating the associated Event
Creates a new Sound object, imports a WAV file into it, and then creates an Event with a Play action on the Sound.

Importing a WAV file into an Audio File Source
Creates a Sound SFX object and its audio source. The property field Sound object is also set.

Importing a WAV file to create a Sound SFX object
Creates a Source SFX object and an audio file source object and imports its wave file.

Importing an audio file
Imports an audio file from a tab-delimited file

Importing an audio file to create a Sound SFX using a relative object path
Imports files using the importLocation, a relative objectPath, and an objectType.

Importing an audio file to create a Sound SFX using an absolute object path
Imports files using an absolute objectPath that includes the object type.

Importing an audio file to create a Sound Voice for English
Imports files using an absolute objectPath and specifying the English language.

Importing an audio file to create a Sound Voice for French
Imports files using an absolute objectPath and specifying the French language.

Importing an audio files to create Sound Voices for English and French
Imports files using an absolute objectPath and specifying the language for each entry.

Importing audio files and creating multiple Sound SFX
Imports files specified by "audioFile" into "objectPath"

Importing audio files to create Sound SFX and Audio File Sources
Imports files using an absolute objectPath that includes the object type for the Sound SFX and the Audio File Source.

Importing two WAV files into a Music Segment to create two Music Tracks
Creates a Music Segment, and imports two WAV files. Two new Music Tracks and two Music Clips are also created.

Importing two WAV files to create two Sound SFX objects
Creates two Sound SFX objects and two audio file source objects and imports their wave files.

Launching a stop Action on Event
Executes a Stop action for the given Event, fading out with a 5 s log1 Curve.

Moving an object to a new parent
Moves object "id" and makes it a child of "parent". The object fails if "parent" already contains a child with the same name.

Moving an object to a parent containing a child of the same name
Moves object "id" and makes it a child of "parent". The object is renamed if "parent" already contains a child with the same name.

Mute a WwiseObject
Mutes the object specified by "object".

Muting the specified object
Executes the "Mute" command and specify the mute state.

Opening a project
Opens the .wproj project specified by path.

Opening a project
Opens the .wproj project specified by path.

Pasting a list
Paste the property, reference and list differences from the source object to the target objects. Only the selected "RTPC" list will be pasted, no property or reference differences will be pasted.

Pasting a list and all properties and references
Paste the property, reference and list differences from the source object to the target objects. Only the "RTPC" list will be pasted along with all properties and references. The source object only has "RTPC" and "Metadata" lists.

Pasting a property and all lists
Paste the property, reference and list differences from the source object to the target objects. Only the "Volume" property will be pasted along with all lists for the source object. The source object only has "RTPC" and "Metadata" lists.

Pasting with defaults
Paste the property, reference and list differences from the source object to the target object. All differences will be pasted.

Pasting with exclusion
Paste the property, reference and list differences from the source object to the target objects. Select a non-default paste mode for the lists and paste everything except for the "Volume" property and "RTPC" list.

Pasting with inclusion
Paste the property, reference and list differences from the source object to the target objects. Paste only the "Volume" property and "RTPC" list.

Performing a redo
Performs a redo.

Performing an undo
Performs an undo.

Playing a transport object
Plays the given transport object.

Playing converted files
Setting the useOriginals global option to play converted files

Posting a Trigger by GUID
Posts the specified "trigger" by GUID to be applied on "gameObject".

Posting a Trigger by name
Posts the specified "trigger" by name to be applied on "gameObject".

Posting an Event by Short ID
Posts an Event to the sound engine using the Event's Short ID.

Posting an Event by name
Posts an Event to the sound engine using the Event's name.

Posting an Event by object GUID
Posts an Event to the sound engine using the Event's GUID.

Preparing An Event
Prepare the object and it dependencies for playback and use with the transport object.

Query game objects registered at or before 1 minute.
Gets game objects where the registration time was 60,000 milliseconds or earlier.

Querying the CPU usage at a point in time.
Queries the CPU usage in the current capture session at the latest capture time.

Querying the Loaded Media at a point in time.
Queries the active Loaded Media in the current capture session at the latest capture time.

Querying the Performance Monitor at a point in time.
Queries the Performance Monitor Counters in the current capture session at the latest capture time. For the purposes of this example only a subset of the returned counters are displayed.

Querying the RTPC id and value at a point in time
Queries the active RTPCs in the current capture session at 30 secs (30,000 milliseconds).

Querying the Streamed Media at a point in time.
Queries the active Streamed Media in the current capture session at the latest capture time.

Querying the bus names at a point in time
Queries the bus in the current capture session at 30 secs (30,000 milliseconds).

Querying the game object properties of Audio Object from the Capture Time Cursor
Specifies the Capture Time Cursor as a time to query the Audio Object at the latest time of the capture session when the call is processed.

Querying the game object properties of voices from the Capture Time Cursor
Specifies the Capture Time Cursor as a time to query the voices at the latest time of the capture session when the call is processed.

Querying the instigator ID (pipeline ID) for the Audio Objects at a point in time
Query instigator ID (pipeline ID) for the Audio Objects in the current capture session at 30 secs (30,000 milliseconds).

Querying the sound names at a point in time
Queries the voices in the current capture session at 30 secs (30,000 milliseconds).

Registering a command to edit in Visual Studio Code
Registers a command that's shown in a new Extra menu.

Registering a command to edit in Wavosaur
Registers a command that's shown in the contextual menu only

Registering a command with no program
Registers a command that has no program. Typically used as a callback in Waapi. Simplest example.

Registering a game object
Registers the "MyGameObjectName" game object.

Removing an assignment from a Switch Container
Equivalent to select and delete a child assigned to a State in the Assigned Objects view.

Renaming a WwiseObject
Renames the object specified by "object" to "value".

Resetting an RTPC value using its GUID
Resets the value of "rtpc", using its GUID, to the default for "gameObject".

Resetting an RTPC value using its name
Resets the value of "rtpc", using its name, to the default for "gameObject".

Retrieve all audio files in a specific folder
Returns the absolute path of audio files in a folder.

Retrieve all audio files in the projet
Return the absolute path of audio files that are not used by a Wwise object and all folders under the Originals folder.

Retrieve unused audio files in the projet
Return the path of audio files that are not used by a Wwise object.

Retrieving a SoundBank's inclusion list
Gets a SoundBank's inclusion list.

Retrieving information about an object property
Retrieves information about an object property.

Retrieving the SoundBank log
Uses the channel 'soundbankGenerate' to retrieve the latest SoundBank generation log.

Retrieving the list of property and reference names of an object
Retrieves the list of property and reference names of an object.

Retrieving the list of transport objects
Retrieves the list of transport objects.

Returning the property and list differences
Returns the property and list differences between 2 objects.

Reverting a file modification in the source control.
The modification is canceled and the contents of the file return to what was before the checkout.

Saving a profiler capture
Saves the current profiler capture to the file "capture.prof".

Saving the current project
Saves the current project.

Searching objects by text
Search objects with 'gun' in the name.

Searching objects of a certain category
Retrieves the id and name of objects with "Tone" in their text properties and filters the results to retrieve only those within the category "Actor-Mixer Hierarchy".

Searching objects of a certain type
Retrieves the id, name and notes of objects with "Tone" in their text properties and filters the results to retrieve only those of type "Sound". Refer to Wwise Objects Reference for the types available.

Seeking to 35% of duration
Seeks on "gameObject" referenced in the Play Action of "event" at 35% of the duration.

Seeking to position 1 s
Seeks on "gameObject" referenced in the Play Action of "event" at 1 second.

Sending a message to the profiler
Sends the "message" to the Profiler.

Set state properties to a Sound
Sets BypassEffects and Volume state properties to a Sound.

Setting a list of listeners for a game object
Sets "listeners" as the list of active listeners for "gameObject".

Setting an RTPC value using its GUID
Sets the value of "rtpc", using its GUID, to "value" for "gameObject".

Setting an RTPC value using its name
Sets the value of "rtpc", using its name, to "value" for "gameObject".

Setting an effect plug-in
Sets the effects of a Sound to a newly created Custom RoomVerb Effect plug-in.

Setting an object reference
Sets the Output Bus on the specified object.

Setting multiple positions for a game object
Sets "gameObject" to multiple positions, as defined in "positions", to simulate multiple sources for one playing sound.

Setting the "Curve" reference of an RTPC
Sets the curve points of a specified RTPC.

Setting the Auxiliary Busses for a game object
Sets the Auxiliary Busses of "emitter" for "listener"s specifying the bus name and value for each.

Setting the State Group to another State using Short IDs
Sets "stateGroup" to "state".

Setting the State Group to another State using names
Sets "stateGroup" to "state".

Setting the Switch Group to another State using Short IDs
Sets "switchGroup" to the "switchState" for "gameObject".

Setting the Switch Group to another State using names
Sets "switchGroup" to the "switchState" for "gameObject".

Setting the Volume randomizer values of a Sound object
Sets the randomizer attributes corresponding to the "Volume" property of the object defined by "object".

Setting the active source for a Sound Voice.
Setting the active source for a Sound Voice. The Sound has a main source and an alternate source.

Setting the emitter's output bus volume for the listener
Amplifies the output bus volume of the emitter for the listener by using the multiplier control value.

Setting the list of default listeners
Sets "listeners" as the list of default listeners.

Setting the listener spatialization
Sets the spatialization for "listener" using "volumeOffsets" to pan to the left.

Setting the notes of an object
Sets the notes of the object defined by "object".

Setting the obstruction and occlusion level of a game object
Sets the "emitter"'s "obstructionLevel" and "occlusionLevel" for the "listener".

Setting the position of a game object
Sets the position of "gameObject" to "position/position" with the provided orientation.

Setting the scaling factor of a game object
Sets the scaling factor of "gameObject" to "attenuationScalingFactor" (200%).

Setting the trigger of a MusicStinger.
The object field contains the id of the MusicStinger we want to change.

Setting the value of a specified property on the specified platform
Sets the "Volume" property of the object defined by "object" to "Value".

Setting the values of the name, notes, a property and a reference
Setting the name, notes, "Volume" property and "OutputBus" reference of the object defined by "object" . See the examples for ak.wwise.core.object.setName , ak.wwise.core.object.setNotes , ak.wwise.core.object.setProperty and ak.wwise.core.object.setReference to compare the two schemas.

Setting the volume
Sets the "Volume" property of the object defined by "object" to "Value".

Solo a WwiseObject
Solos the object specified by "object".

Stopping a current content playing
Stops the content, specified by "playingId", by using "transitionDuration" with a Linear Curve.

Stopping a currently playing content
Stops playing all the content associated with "gameObject".

Stopping all transport objects
Stops all transport objects.

Toggling playback (pause / resume) on a transport object
Toggles playback (pause / resume) on the given transport object.

Toggling playback (play / stop) on a transport object
Toggles playback (play / stop) on the given transport object.

Toggling the Mute state on the specified object
Executes the "Mute" command without specifying a value to toggle the current state.

Unmute all objects
Unmute all muted objects in Wwise.

Unregistering a game object
Unregisters "gameObject".

Unregistering a list of commands
Unregisters everything from the ak.wwise.ui.commands.register examples.

Unsolo all objects
Unsolo all soloed objects in Wwise.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise