版本

menu_open
Wwise SDK 2023.1.6
导入音频文件和创建架构

有好几种方式在 Wwise Authoring API 中创建 Wwise 对象。

创建 Wwise 对象

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

备注: ak.wwise.core.object.set offers a superset of the functionalities offered in ak.wwise.core.object.create. We recommend using ak.wwise.core.object.set.

Advantages of ak.wwise.core.object.set over ak.wwise.core.object.create :

  • Support for creating and modifying objects
  • Support for batch operations
  • Support for importing audio files

理解名称冲突模式

在调用 ak.wwise.core.object.createak.wwise.core.object.set 时,可指定四种名称冲突模式之一。

如果在目标位置存在同名对象:

  • fail: The create function returns an error. (default)
  • 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.

了解列表和列表模式

列表是用于存储对象的通用容器。给定列表中的对象通常属于同一类型。列表方便通过 WAAPI 填充和检索被另一对象“拥有”的对象。比如,给定对象的 RTPC 包含在该对象的 RTPC 列表中。

在调用 ak.wwise.core.object.set 时,可指定两种列表模式之一。

若列表已经包含对象:

  • append:在可能的情况下将新的对象添加到列表,同时保留现有对象。有些列表可能不允许存在重复的同等对象:比如,RTPC 列表中的有些 RTPC 属性是排他性的,所以只能有一个 RTPC 具有此类属性。
  • replaceAll:移除所有现有对象,并添加新的对象(对重复项有限制)。

对于空白列表,行为为 append。

ak.wwise.core.object.create 相关限制

Sound SFX

利用 ak.wwise.core.object.create ,可以创建 Sound SFX(音效)对象。不过存在很大的限制:

  • 无法将原始 WAV 或 MIDI 文件关联到子级 Audio File Source 对象。
  • 无法将语言关联到子级 Audio File Source 对象。

For this reason, we don't recommend using ak.wwise.core.object.create to create Sound objects that use WAV or MIDI files.

Instead, refer to:

插件

无法使用 ak.wwise.core.object.create 创建源插件、效果器插件或元数据插件。 Use ak.wwise.core.object.set instead.

Limitations with ak.wwise.core.object.create and ak.wwise.core.object.set

Work Unit

在使用 ak.wwise.core.object.createak.wwise.core.object.set 创建 Work Unit 之前,需要先清理撤消/重做历史记录和剪贴板。 Work Unit 会在创建的同时保存,便于在工程中快速创建对应的 WWU 文件。

  • onNameConflict 参数只能是 'fail''merge''rename'。不支持 'replace' 模式。

Query

It is possible to create Query objects with ak.wwise.core.object.create and ak.wwise.core.object.set. However, the criteria objects need to be created with a specific GUID as the name. The name of the criteria must contain the GUID of the SearchOperationID attribute as found in the WWU files. Each criteria type has a unique GUID.

To find the correct GUID to use in the name, you will need to reverse engineer the WWU files:

  • Create a Query object in the Query Editor
  • Add the Criteria you wish from the Criteria Browser
  • Modify the property fields in the Criteria Editor
  • Save the project
  • Open the Work Unit in a text editor
  • Look for SearchOperationID and use it for the SearchCriteria name in ak.wwise.core.object.set.
  • Look for the properties in the WWU file as examples and set them in ak.wwise.core.object.set.

列表

无法使用 ak.wwise.core.object.set 创建对象来填充 Metadata 和 Clips 列表。

  • 无法创建元数据插件。
  • 片段需要 AudioSourceRef,但其无法指定。

考虑到以下限制,建议不要使用 ak.wwise.core.object.set 在 Sequences 和 Stingers 列表中创建对象。

  • 鉴于无法通过 WAAPI 将 Segment 指派给 Stinger,建议不要在 Stingers 列表中创建 Stinger。
  • 鉴于无法通过 WAAPI 创建 MusicClip,建议不要在 Sequences 列表中创建 MusicSequence。

Using ak.wwise.core.object.set to import audio files and create a hierarchy of objects

请参阅 ak.wwise.core.object.set 了解更多信息。

{
"objects": [
{
"object": "\\Actor-Mixer Hierarchy\\Default Work Unit",
"children": [
{
"type": "ActorMixer",
"name": "FootSteps",
"@Volume": "-2",
"children": [
{
"type": "RandomSequenceContainer",
"name": "FootStep_Concrete",
"@RandomOrSequence": "1",
"children": [
{
"type": "Sound",
"name": "FootStep_Concrete_01",
"import":{ "files":[ { "audioFile":"C:\\wave\\cues\\FootStep_Concrete_01.wav" } ],}
},
{
"type": "Sound",
"name": "FootStep_Concrete_02",
"import":{ "files":[ { "audioFile":"C:\\wave\\cues\\FootStep_Concrete_02.wav" } ],}
}
]
}
]
}
]
}
]
}
备注: object 字段指示要在工程中的哪个位置创建对象。跟大多数 Wwise 对象字段一样,object 字段支持对象 ID (GUID) 和对象路径。想要获取对象 id,请参阅 ak.wwise.core.object.get. 比如,您可以通过对象的工程路径来获取它的对象 id。
备注: 若要从 Wwise 工程检索对象 ID,可在按住 Shift 的同时右键单击对象,然后选择 Copy GUID(s) to clipboard

More examples using ak.wwise.core.object.set to import audio files:

导入音频文件

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

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

导入格式非常灵活。您可以导入:

At a glance, the audio file importation allows:

  • 导入和本地化音频文件
  • 自动创建 Actor-Mixer 层级结构
  • 创建 Event(事件)
  • 指派属性值,如 Volume(音量)
  • 指派引用,如 Output Bus(输出总线)

有关此功能的详情,请参阅 https://www.audiokinetic.com/library/edge/?source=Help&id=importing_media_files_from_tab_delimited_text_file

备注: ak.wwise.core.audio.importTabDelimited and ak.wwise.core.audio.import are the preferred ways to create Sound objects and import audio files at the same time. 目前无法将音频文件和语言关联到所创建的对象,所以建议不要使用 ak.wwise.core.object.create 或 \ ref ak_wwise_core_object_set 。

示例:

备注: 确保工程中存在相应语言且大小写匹配。

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅