Wwise SDK 2024.1.0
|
This page contains information that is specific to using the Wwise SDK for the OpenHarmony platform.
Before you can download the OpenHarmony SDK, you must first register a project (see Register a Project) to obtain a license. After your project is approved, OpenHarmony option appears in the Deployment Platforms list in the Audiokinetic Launcher.
To use the Wwise SDK with the OpenHarmony platform, you must install the HarmonyOS NEXT SDK. For the required versions, refer to the appropriate version of the OpenHarmony Release Notes.
To build the sample plug-ins on OpenHarmony, you need the CMake tool included in the HarmonyOS NEXT SDK.
The Wwise SDK precompiled libraries are compiled in the following flavor:
Precompiled support for other ABIs might be added in the future.
There are two ways of deploying and loading SoundBanks on OpenHarmony.
Before you build the HAP, place the SoundBanks and media files in the src/main/resources/rawfile
subfolder of the OpenHarmony module that runs the sound engine. Files in this location are packaged in the HAP at build time.
Next, the application must perform the following actions in native code:
NativeResourceManager
object.CAkDefaultIOHookDeferred
, located in the SDK/samples/SoundEngine/OpenHarmony
directory.CAkDefaultIOHookDeferred::UseResourceManager()
and pass the resource manager object created in step 1.CAkDefaultIOHookDeferred::AddBasePath()
and pass a path relative to the rawfile directory, prefixed with rawfile://
. For example, if you placed SoundBanks in src/main/resources/rawfile/StreamingAssets/Wwise
, specify the base path rawfile://StreamingAssets/Wwise
.Note: If you are not using the sample low-level I/O hook included in the Wwise SDK, you must implement your own I/O hook to read the packaged files using OpenHarmony's rawfile API. Because OpenHarmony's rawfile API is read-only, base paths prefixed with |
The SoundBanks can be deployed anywhere in the file system of the device. You can add as many directories as you want with CAkDefaultIOHookDeferred::AddBasePath()
. Any base path not prefixed with rawfile://
is interpreted as a standard POSIX filesystem path, and files are read and written using the standard POSIX file I/O functions. Files that must be opened in write mode use these paths exclusively.
The I/O system searches for files in the specified paths in reverse order, starting with the most recently added path.
For instructions on how to implement the low-level I/O submodule, see Low-Level I/O.
Wwise handles audio interruptions (such as incoming calls or alarms) automatically. Wwise suspends the sound engine during an interruption and reactivates it when the interruption ends.
By default, Wwise keeps playing back audio even when the app loses focus and is hidden from view. To stop playback when the app is out of focus, call AK::SoundEngine::Suspend
when the app is hidden, and AK::SoundEngine::WakeupFromSuspend
when the app is shown. You can register Event listeners for these transitions from ArkTS through the Window module, or from C/C++ using the Xcomponent module.
Refer to Integration Demo Sample for an example of how to handle Xcomponent's SurfaceHide and SurfaceShow callbacks to suspend and resume the sound engine.
To ensure successful initialization of the Communications module, make sure that your application module requests the ohos.permission.INTERNET
permission. When this permission is granted by the OS, the Communications module can open the proper TCP and UDP ports to allow communication with the Wwise Profiler.
For information on how to initialize the Communications module, see Initializing communications.
To ensure Wwise Motion works properly, make sure that your application module requests the ohos.permission.VIBRATE
permission. When this permission is granted by the OS, Wwise Motion can vibrate the device appropriately.
Note that OpenHarmony device vibration capabilities are very coarse and do not permit fine-tuned, high-resolution haptic feedback. On this platform, Wwise Motion is best used for fixed-intensity rumble effects and short-lived UI haptic feedback pulses.
Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !
Visitez notre page d'AideEnregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !
Partir du bon pied avec Wwise