目录
Wwise Unity Integration Documentation
|
Spatial Audio 教程准备工作
为了成功完成 Surface Reflector 教程 和 Room 和 Portal 教程 ,请务必执行以下步骤:
1. 创建 Unity 工程
安装最新版本的 Wwise 和 Unity,并按照以下步骤构建工作环境。
- 启动 Unity 并创建一个新的工程。
- 关闭 Unity。
- 启动 Wwise Launcher 并将 Wwise 集成到 Unity 工程中。
2. Wwise 工程准备工作
对于所述教程,您需要添加 Sound SFX,然后创建用于播放的 Event,并生成 SoundBank。
- 启动 Launcher,并选择在 Wwise 中打开工程。
- 在 Actor Mixer Hierarchy 的 Default Work Unit 下添加 Sound SFX。在 Wwise Integration 工程中,我们添加了一个对白声音。
- 为其导入声音。
- 打开 Sound Property Editor:
- 在 General Settings 选项卡中,选中 Use game-defined auxiliary sends。<br>
Sound Property Editor General Settings tab - 在 Positioning 选项卡中,选中 Listener Relative Routing,并将 3D Spatialization 设为 Position + Orientation。也可以添加 Attenuation。<br>
Sound Property Editor Positioning tab
- 在 General Settings 选项卡中,选中 Use game-defined auxiliary sends。<br>
- 右键单击 Actor-Mixer Hierarchy 中的 Sound SFX,然后依次选择 New Event > Play 。<br>
Event Editor - 转到 SoundBank 布局(快捷键 F7),并添加新的 SoundBank。将 Event 拖入新的 SoundBank。Wwise Integration 工程中的 SoundBank Manager 应如下图所示:
SoundBank Manager and Editor - 保存工程。
3. Unity 工程准备工作
在本节中,我们将创建游戏区域及其中的对象。我们需要设置听者、发声体和两个房间。首先,启动 Launcher 并选择在 Unity 中打开工程。然后,打开 Wwise Picker (Windows > Wwise Picker),点击 Refresh Project,然后选择 Generate SoundBanks。<br>

Wwise Picker
3.A. 环境
- 使用 Cube 创建 Floor、Wall 和 Ceiling: GameObject > 3D Object > Cube 。
Object Name Position Rotation Scale Floor (0, 0, 0) (0, 0, 0) (50, 0.5, 50) Wall Front Left (-4.5, 3, -10) (0, 0, 0) (7, 6, 0.5) Wall Front Middle (0, 5, -10) (0, 0, 0) (2, 2, 0.5) Wall Front Right (2.5, 3, -10) (0, 0, 0) (3, 6, 0.5) Wall Left Small (-7.75, 3, -6) (0, 0, 0) (0.5, 6, 8) Wall Back Small (-2, 3, -2) (0, 0, 0) (12, 6, 0.5) Ceiling Small (-2, 5.75, -6) (0, 0, 0) (12, 0.5, 8) Wall Right Small (3.75, 3, -8) (0, 0, 0) (0.5, 6, 3.5) Wall Front Large (11.5, 3, -7.5) (0, 0, 0) (16, 6, 0.5) Wall Right Large (19.25, 3, 3.25) (0, 0, 0) (0.5, 6, 21.5) Wall Middle (3.75, 5, -4.5) (0, 0, 0) (0.5, 2, 3.5) Wall Left Large (3.75, 3, 5.625) (0, 0, 0) (0.5, 6, 16.75) Wall Back Large (11.5, 3, 14) (0, 0, 0) (16, 6, 0.5) Ceiling Large (11.5, 5.75, 3.25) (0, 0, 0) (16, 0.5, 22) Barrier (-4.5, 3, -17) (0, 0, 0) (7, 6, 0.5) - 在房间内添加 Spotlight ( GameObject > Light > Spotlight )。
Object Name Position Rotation Scale Spotlight Small Room (-3, 5.75, -6) (0, 0, 0) (1, 1, 1) Spotlight Large Room (11.5, 5.75, 5) (0, 0, 0) (1, 1, 1) - 在 Light 组件中,更改以下参数:
- 将 Range 设为 30。
- 将 Spot Angle 设为 179。
- 在 Light 组件中,更改以下参数:
3.B. 角色听者
- 根据需要自行创建一个角色。
Object Name Position Rotation Scale MainCharacter (0, 1.3, -20) (0, 0, 0) (1, 1, 1) - 移除所有 Unity Audio Source。
- 将 Ak Audio Listener 组件添加到镜头。<br>
Ak Audio Listener component - 将 Ak Spatial Audio Listener 组件添加到镜头。<br>
Ak Spatial Audio Listener component
3.C. 第三人称发声体
- 使用 Cylinder 创建 Button ( GameObject > 3D Object > Cylinder )。
Object Name Position Rotation Scale Button Outside (-3, 0.75, -15) (0, 0, 0) (0.15, 0.5, 0.15) Button Small Room (-3, 0.75, -5) (0, 0, 0) (0.15, 0.5, 0.15) Button Large Room (7.5, 0.75, 5) (0, 0, 0) (0.15, 0.5, 0.15) - 添加 Ak Spatial Audio Emitter 组件。 Ak Spatial Audio Emitter component
- 在 Ak Game Obj 组件中:
- 选中 Environment Aware 选项。
- 选中 Use Default Listener 选项。 Ak Game Obj component
- 添加 Ak Ambient 组件:
- 在 Trigger On 中选择所需声音触发方式。
- 在 Event Name 中选择 Play_sound 事件。 Ak Ambient component
- 添加 Ak Bank 组件:
- 将 2. Wwise 工程准备工作 中创建的 SoundBank 添加到 Bank Name。 Ak Bank component
- 将 2. Wwise 工程准备工作 中创建的 SoundBank 添加到 Bank Name。
- 启动游戏并连接到 Wwise,然后打开 Profiler 布局(快捷键 F6)。
- 播放 Button 声音。此时,应会听到 Wwise 工程中导入的声音。
- 在 Voices Graph 选项卡中,应会看到以下声部图。 Button Outside Voice Graph with no Effect
3.D. 场景
- 将场景保存到合适位置。
- 下图中显示了最终创建的场景。Unity Integration 文件包中提供有此场景。为方便起见,场景中的元素具有各种颜色。另外,还添加了第一人称控制器使其可以移动。 Tutorial Unity Scene
生成于 2020年 一月 23日 星期四 10:26:19 , 为 Wwise Unity Integration Documentation使用
