menu
 
版本
2024.1.4.8780

2024.1.4.8780

2023.1.12.8706

2022.1.18.8567

2021.1.14.8108

2019.2.15.7667

2019.1.11.7296

2018.1.11.6987

2017.2.10.6745

2017.1.9.6501

2016.2.6.6153

2015.1.9.5624


menu_open
目标平台:
Wwise SDK 2024.1.4
针对 Android 的相关信息

本页包含有关将 Wwise SDK 用于 Android 平台的特定信息。

平台要求

若要结合 Android 平台使用 Wwise SDK,必须安装 Android SDK、Android SDK Tools 和 Android NDK。

info

备注:

  • The build scripts are dependent on the Android NDK toolchain, as pointed by NDKROOT environment variable.

You can build the Android libraries using the script BuildAllAndroid.cmd with the desired platform and configuration (i.e. BuildAllAndroid.cmd armeabi-v7a debug) on Windows in the SDK/source/SoundEngine folder. This will call CMake with the appropriate parameters. This script can target the 4 supported architectures (armeabi-v7a, x86, arm64-v8a and x86_64) in 3 configurations (Debug, Profile, Release).

使用 Fast Audio Path(低延迟)

在最近的操作系统版本中,Google 引入了 Fast Audio Path 功能。如果满足一些条件,这样做会旁通一些内部处理,极大地减少操作系统和硬件处理的延迟。请参阅 控制Android上的延迟 了解更多详情。

部署和加载 SoundBank

在 Android 中部署和加载 SoundBank 有三种方式:

  1. 将 SoundBank 当作 Android 应用程序包(APK)的一部分进行部署。
    在将应用程序部署至设备前,必须将 SoundBank 放入 Android NDK 工程的 assets 子文件夹,并通过 APK(或其他工具的等效过程)正常打包。为了从 APK 读取音频包文件,必须指定音频包相对于 APK 存档内标准 assets 目录的路径。为此,请调用 CAkDefaultIOHookDeferred::SetBasePath() 。此操作不会自动完成。
  2. 将 SoundBank 装入 Android Application Split Binary(又称为OBB)进行部署。 为了从 OBB 读取 SoundBank,必须确保音频包在 OBB 内的相对路径与主 APK 中的设置相同。
  3. 将 SoundBank 直接部署到 Android 设备文件系统中。 SoundBank 可部署到设备文件系统中的任何位置。您可以通过 CAkDefaultIOHookDeferred::AddBasePath() 添加任意数量的目录。

位于 $<Wwise>/SDK/samples/SoundEngine/Android 中的底层 I/O 的默认实现可访问 APK、OBB 和 POSIX 文件。您必须通过 JavaVM 和 android.app.Activity 调用 CAkDefaultIOHookDeferred::InitAndroidIO 函数来对 APK 和 OBB 解析器进行初始化。

info备注: OBB 包必须解密,之后默认 Low-Level I/O 才能正常工作。否则需要编写自己的 IO。
info备注: OBB 读取操作通过 libzip 执行,请检查 Libzip 下的授权。如果您不接受该授权,则可通过在编译选项中定义“REMOVE_LIBZIP”符号来禁用 LibZip。在这种情况下,您需要编写自己的 I/O hook 来读取 OBB 或在使用前解压 OBB。

IO 系统将在给定路径中逆序查找文件,先添加最新内容,最后添加 APK 内容。这样 DLC 内容便可替换 APK 内容了。

请参阅 Low-Level I/O 了解有关如何实现 Low-level I/O 子模块的信息。

Android 库特点

安装包中的 Wwise SDK 库采用以下编译方式:

  • 在 armeabi-v7a 架构上支持 NEON 指令集
  • 在 x86 架构上支持 SSE 指令集
  • 在 arm64-v8a 架构上支持 NEON 指令集
  • 在 x86_64 架构上支持 SSE 指令集

Android Audio APIs

Wwise supports the following audio APIs on Android:

By default, Wwise automatically selects the most suitable API based on a variety of parameters including:

  • Device make and model.
  • Android OS version.
  • Whether the Allow 3D Audio Audio Device property is enabled in the Wwise project.

To force Wwise to use a specific API, set AkPlatformInitSettings::eAudioAPI to the appropriate value.

3D Audio 支持

现在 Android 提供对 Wwise 3D Audio 的支持。Two technologies are possible: Dolby Atmos and Android's Spatial Audio technology (distinct from Wwise Spatial Audio). Both are designed for headphone output and support a spatialized bed and a passthrough mix. 不过,不支持 System Audio Object。

Wwise chooses the appropriate technology based on device capabilities and initialization settings. To activate 3D Audio, these conditions must be met:

  • The Allow 3D Audio Audio Device property is enabled in the Wwise project.
  • AkInitSettings::settingsMainOutput uses default settings, or specifies a standard channel configuration that has height channels such as 7.1.4 or 5.1.4.

When these conditions are met, 3D audio can be activated.

If the device supports Dolby Atmos, this technology is selected. Otherwise, if the following conditions are met, Android Spatial Audio is selected.

Android 13 及更高版本的操作系统针对有线和无线耳机提供有 Spatial Audio 用户偏好设置。

建议允许用户通过游戏设置选择是否使用 3D Audio,并根据此设置来自由选用两个 Audio Device 共享集。

Using 3D Audio with Dolby Atmos

Upon initialization, when using 3D Audio with Dolby Atmos, the main mix is configured as 5.1.4. Dolby Atmos for Android does not support other channel configurations.

info备注: Dolby Atmos is the preferred 3D Audio solution because it is optimized with latency suitable for gaming. However, note that Android does not support the low-latency "Fast Audio Path" when using Bluetooth headphones. For best results with Dolby Atmos, use wired headphones. See 使用 Fast Audio Path(低延迟) for more information.

Using 3D Audio with Android Spatial Audio

Upon initialization, when using 3D Audio with Android Spatial Audio, the main mix is configured as 7.1.4 PCM (default), unless the Main Mix Configuration property of the Audio Device is set to a different value. These are the supported main mix PCM channel configurations for use with Android Spatial Audio:

  • 5.1.2
  • 5.1.4
  • 7.1.2
  • 7.1.4(推荐)
info备注: Android Spatial Audio does not support the low-latency "Fast Audio Path", even when using wired headphones. This is why Wwise does not activate Android Spatial Audio when AkPlatformInitSettings::bEnableLowLatency is set to false. See 使用 Fast Audio Path(低延迟) for more information.

Android 版本说明


此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅