Wwise SDK 2024.1.1
|
The Wwise Project Database is a dynamic library that provides a memory-based database view of the current state of a Wwise project’s generated SoundBanks. All information available in the JSON metadata files produced when SoundBanks are generated is accessible in the Project Database.
All code presented in this section is available in a sample project in the samples\WwiseProjectDatabase
directory.
There are two types of information in the database:
The Metadata structures are defined exactly like the JSON files that describe the generated SoundBank metadata. No context is provided and the member names in these structures are identical to those in the JSON files.
The file definition begins with a WwiseMetadataRootFile
object that defines the kind of optional root objects the file can declare. The structures expose the possible inner objects and values.
After they are loaded in memory, these structures provide a concise and clear representation of the generated SoundBanks.
Only one copy of this information is kept in memory in WwiseRootDataStructure
and WwisePlatformDataStructure
JSON files.
The Ref classes define each metadata object by its relation to related metadata. This class is helpful because the metadata in the generated SoundBanks minimizes duplicated information, and instead uses references to various data structures. For example, a media list references an Event ID, but the metadata for that media, such as the file location, is defined in the higher-level SoundBank metadata.
To reference an Event’s Switch Container value, a Ref class keeps a copy of a shared pointer to the file’s root and contains directions to locate the Switch Container, such as "this file, in the SoundBanks structure, the first SoundBank, the fourth declared Event, the third declared Switch Container."
The following code samples demonstrate how these classes work:
Here is a media example:
Essentially, the Ref classes provide context. Therefore, you can get information about the Switch Container as well as the class parents: the Event, the SoundBank, and the file.
Some referred types require additional information. For example, the platform information is divided into two complementary files: ProjectInfo.json
and PlatformInfo.json
, so the platform Ref contains two different structures. Similarly, some other referred types might reside in multiple locations. The Ref class attempts to accommodate these particularities.
Finally, the Ref classes provide additional utilities. If you pass the necessary global maps, you can get supplemental information alongside the Ref classes that are included in the specified Wwise object. For example, you can ask for the media requested in a particular Event’s definition, and it returns the media as Refs.
Because the Ref information is declared as the base and derived structs, in a Switch Container you can request all of the Event’s Switch Container values and get the siblings simultaneously. The same is true for other types of information contained in Events.
At a higher level, the AnyRef class contains a pointer to any kind of Ref structure or a Null object. The AnyRef class contains the type and a shared pointer. There are limited operations available at the AnyRef level, such as retrieving the object’s Short ID, its GUID, and its name. For everything else, you can cast the boxed Ref object to its type.
The WwiseProjectDatabase handles queries through its access methods from the API.
Inside the Data structure, there are two structures:
The Data structure’s structs contain:
GeneratedPlatformFiles
property.JsonFiles
property.In addition, the Data structure allows templated access through functions such as GetRef
.
The following code samples demonstrate how to determine whether a SoundBank is an Auto-Defined SoundBank:
The Wwise Project Database binaries are available in the \[Debug|Profile|Release]\bin
directory. To rebuild the application yourself, follow these steps:
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요