版本

menu_open

Defining how objects within a container are played

Containers can contain multiple objects. When a container is played, one or all of its child objects is played depending on the Play Mode setting:

Step play mode

You might want one object within the container to be played each time it is called. For example, each time a handgun is fired you might want only one sound to be played. As another example, each time a character speaks you might want them to deliver only one line of dialogue. To achieve this, set the play mode of the container to Step.

The following illustration shows what happens when a handgun is fired and the sounds for that handgun are in a Random Container in step mode.

To play one object in the container:

  1. Open the Property Editor for a Random or Sequence Container.

  2. In the Property Editor, select the Step option of the Play Mode property.

    每次播放容器时,将仅播放一个对象。

Continuous play mode

In other situations, you might want all the objects in the container to be played each time the container is played. For example, when certain guns in your game are fired, a series of sounds that must be played in sequence. To achieve this, set the Play Mode of the container to Continuous.

[备注]备注

Continuous 播放模式始终应用于游戏对象作用域。有关更多详细信息,请参阅 “Defining the scope of containers”一节 章节。

下图显示了当特定枪支开火时,Wwise 如何使用 Continuous 模式的序列容器来播放声音序列。

在 Continuous 模式下将播放容器内的所有对象,这意味着您可以添加循环,并在对象间应用各种过渡。

[备注]备注

When a Random Container is in Continuous mode, some objects might be repeated several times before the complete list has played once. 这是由于对容器内的各个对象都应用了权重。

播放容器内的所有对象的方法如下:

  1. Open the Property Editor for a Random or Sequence Container.

  2. In the Play Mode property, select the Continuous option.

  3. For Sequence Containers, enable Always reset playlist to return the playlist to the beginning each time the container is played. 如果您未勾选该选项,则容器将从上次停止处继续播放,更确切地说是从播放列表中下一个对象的起始处播放。

  4. Enable Loop to loop the entire contents of the container.

  5. 选择以下选项之一:

    • Infinite Looping to specify that the container will be repeated indefinitely.

    • No. of Loops,指定容器将播放特定次数。

  6. 如果您选择 No. of Loops 选项,请输入容器将被播放的次数。

  7. 选择 Transitions 选项,可以在播放列表中的对象间应用过渡。

    Transition 参数变为可用。

  8. 从 Type 列表中,选择以下任一选项:

    • Xfade (amp) 淡变(恒定振幅),在两个对象之间保持恒定振幅进行交叉淡变。

    • Xfade (power) 淡变(恒定功率),在两个对象之间保持恒定功率进行交叉淡变。

    • Delay 延迟,在两个对象之间添加无声段落。

    • Sample Accurate 精确到采样点,对象之间进行零延迟的无缝过渡。Note that the Opus audio format, when streamed from disk, is not reliable for sample accurate transitions.

    • Trigger rate 触发速率,使用特定速率来触发容器内的对象。该选项对于模拟快速枪声十分实用。除此之外,也可使用 MIDI 来以更高的精度发送每个子弹声音。有关详细信息,请参阅 SDK 文档中的模拟快速射击章节。

    [备注]备注

    在使用 Xfade、Sample accurate 和 Trigge rate 时有一些局限性。以下几点值得注意:

    • Blend Container 和 Switch Container 不支持交叉淡变(Xfade)。当子级 Blend/Switch Container 播放时,其父级 Random/Sequence Container的 Xfade 设置也无法正常工作。

    • 假如为 Random/Sequence Container 应用了精确到采样点的过渡,若在当前声音末尾使用中断动作退出循环播放,而没有足够时间预取接下来要播放的声音,则可能会导致无法精确地过渡到指定的声音。为了避免这一问题,可针对这些声音使用内存内容(不进行流播放,也不使用硬件编解码器)。

    • 对于使用了 Xfade 或 Trigger rate 过渡方式的容器,带有 Fade out 的 Stop Action 将不起作用。为容器调用 StopEvent 时,如果 Fade out 时间比当前播放的声音更长,则播放结束时声音会突然切断。要避免这种情况,可以使用 Set Voice Volume Action 进行淡出,并延迟 Stop Action。

  9. Duration 文本框中,输入所需的交叉淡变、延迟或触发速率的时长。

    [备注]备注

    Duration 选项不适用于精确到采样点的过渡。


此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅