Table of Contents

Importing Audio Files and Creating Structures

There are several ways of creating Wwise objects with the Wwise Authoring API.

Creating Wwise Objects

It is possible to create most Wwise Objects using ak.wwise.core.object.create. To learn more about the limitations, refer to Limitations with ak.wwise.core.object.create.

Understanding the name conflict modes

When calling ak.wwise.core.object.create, it is possible to specify one of the 4 name conflict modes:

If an object already exists at destination with the same name:

  • fail: The create function returns an error.
  • replace: The object at destination is deleted (including its children), and a new object is created.
  • rename: A new unique name is automatically assigned for the new object, appending numbers to it.
  • merge: The object at destination is re-used, and the specified properties, references and children are merged to the destination leaving untouched the rest of the object.

Limitations with ak.wwise.core.object.create

Sounds

It is possible to create Sound objects using ak.wwise.core.object.create. However, it has important limitations:

  • It is not possible to associate an original WAV file to a child Audio Source object.
  • It is not possible to associate a language to a child Audio Source object.

For these reasons, we don't recommend using ak.wwise.core.object.create to create Sounds until we fully support the missing features. Please instead refer to Importing Audio Files and ak.wwise.core.audio.import.

Work Units

Creating Work Units with ak.wwise.core.object.create requires the undo/redo history and the clipboard to be cleared. The Work Unit will also be saved upon creation, effectively creating a corresponding WWU file in the project.

Queries

It is not possible to create Query objects with ak.wwise.core.object.create.

Using ak.wwise.core.object.create to create a single Actor-Mixer:

Refer to ak.wwise.core.object.create for more information.

{
    "parent": "{a9129d80-07e0-11e7-93ae-92361f002671}",
    "type": "ActorMixer",
    "name": "My Actor-Mixer",
    "children": []
}
Note.gif
Note: The parent field indicates where to create the object in the project. The parent field, like most Wwise object fields, supports object ids (GUID) and object paths. To retrieve an object ID, refer to ak.wwise.core.object.get. You could, for example, retrieve the object ID by its project path.
Note.gif
Note: To retrieve an object ID from a Wwise project, you can hold the key SHIFT while right-clicking an object, then select Copy GUID(s) to clipboard.

Using ak.wwise.core.object.create to create a hierarchy of objects with properties:

Refer to ak.wwise.core.object.create for more information.

{
    "parent": "{a9129d80-07e0-11e7-93ae-92361f002671}",
    "type": "ActorMixer",
    "name": "Weapons",
    "@Volume": "-2",
    "children": [
        {
            "type": "RandomSequenceContainer",
            "name": "BigGun",
            "@RandomOrSequence": "1",
            "children": [
                {
                    "type": "Sound",
                    "name": "Gun1",
                },              
                {
                    "type": "Sound",
                    "name": "Gun2",
                }
            ]
        }
    ]
}

Using ak.wwise.core.object.create to create Events

Refer to ak.wwise.core.object.create for more information.

{
    "parent": "\\Events\\Default Work Unit", 
    "type": "Folder", 
    "name": "WAAPI", 
    "onNameConflict": "merge", 
    "children": [
        {
            "type": "Event", 
            "name": "Play_SFX", 
            "children": [
                {
                    "name": "", 
                    "type": "Action", 
                    "@ActionType": 1, 
                    "@Target": "\\Actor-Mixer Hierarchy\\Default Work Unit\\SFX"
                }
            ]
        }
    ]
}

Refer to Action for the list of possible event properties and action types.

Importing Audio Files

Audio files can be imported using the Wwise Authoring API by means of the same importation processor available through the Tab Delimited import in the Audio File Importer.

Using the Wwise Authoring API allows complete automation of the importation process and provides direct control in the programming language of your choice.

The import format allows great flexibility. You can import:

At a glance, the audio file importation allows:

  • Importation and localization of audio files
  • Automatic creation of actor mixer hierarchies
  • Creation of Events
  • Property Value assignation, such as Volume
  • Reference assignation, such as the Output Bus

For more information about it, refer to https://www.audiokinetic.com/library/edge/?source=Help&id=importing_media_files_from_tab_delimited_text_file.

Note.gif
Note: ak.wwise.core.audio.importTabDelimited and ak.wwise.core.audio.import are the prefered ways to create Sound objects and import audio files at the same time. We do not recommend using ak.wwise.core.object.create because it is currently not possible to associate an audio file and a language to created objects.

Examples:

Importing a WAV file, and creating the associated Sound object.

Using ak.wwise.core.audio.import to import audio files

Refer to ak.wwise.core.audio.import for more information.

{
    importOperation: "createNew",
    default: {
        importLanguage: "SFX"
    },
    imports: [
        {
            objectPath: "\\Actor-Mixer Hierarchy\\Default Work Unit\\<Sound>MyNewSound1",
            audioFile: "C:\\Wave\\cues\\1.wav",
            "@Volume": 0.42
        },
        {
            objectPath: "\\Actor-Mixer Hierarchy\\Default Work Unit\\<Sound>MyNewSound2",
            audioFile: "C:\\Wave\\cues\\2.wav",
            "@Volume": 0.1
        }
    ]
}

Using ak.wwise.core.audio.import to localize audio files

Refer to ak.wwise.core.audio.import for more information.

To import a Sound Voice in English:

{
    importOperation: "useExisting",
    default: {
        importLanguage: "English(US)"
    },
    imports: [
        {
            objectPath: "\\Actor-Mixer Hierarchy\\Default Work Unit\\<Sound>MyVoice",
            audioFile: "C:\\sources\\en\\Hello.wav"
        }
    ]
}

To localize a Sound Voice in French:

{
    importOperation: "useExisting",
    default: {
        importLanguage: "French"
    },
    imports: [
        {
            objectPath: "\\Actor-Mixer Hierarchy\\Default Work Unit\\<Sound>MyVoice",
            audioFile: "C:\\sources\\fr\\Hello.wav"
        }
    ]
}
Note.gif
Note: Make sure the language exists in your project, and make sure the case is also matching.