버전

menu_open
알림: 고객님의 주요 출시 버전( 2023.1.8.8601 )에 해당하는 최신 설명서로 이동했습니다. 특정 버전의 설명서를 보시려면 Audiokinetic 런처에서 오프라인 설명서를 다운로드하고 Wwise Authoring의 Offline Documentation을 확인하세요.
Wwise SDK 2023.1.8
오류 모니터링

Most of the SDK functions return an error code when an issue occurs. The Sound Engine, however, runs on its own thread, so it is possible that errors may occur without receiving a direct notification. Before being printed to the user, error codes are parsed by translators that will change the code into a meaningful message and resolve numerical identifiers to object names. By default, messages only go through the DefaultErrorMessageTranslator. See Error Message Translators for more details.

There are several ways to detect errors in the Sound Engine. You can do any of the following:

  • Check for error codes returned by functions in the SDK.
  • Validate the error code that's sent in a callback specified on the sync call. This only applies when using asynchronous functions.
  • Call the function AK::Monitor::SetLocalOutput() to Enable/Disable local output of monitoring messages and errors. For this use case, be sure that the monitoring thread is started. Otherwise, the AkMonitor won't dispatch its notification and nothing will be sent to the local output. To start the monitoring, simply call AkMonitor::Instance()->StartMonitoring(). In the case where you don't want a separate thread running, make sure AkMonitor::Instance()->InitMonitoring() has been called and then manually call AkMonitor::Instance()->DispatchNotification().
  • Connect the Wwise authoring application to the game using either the DEBUG or PROFILE setups. Before doing so, make sure communications are properly initialized. Refer to 커뮤니케이션 초기화 for details.
  • Monitor messages posted by the game using the functions AK::Monitor::PostString() and AK::Monitor::PostCode().

Error Message Translators

Before sending error messages to the user, the Sound Engine sends an error code to the error message translators. The error message translators attempt to parse tags contained in the error code in order to create a more detailed error message. This page explains how to implement the translators in your project.

Implementing Translators

The following sections describe the two components needed when using error message translators.

Callback Function

First, a callback function must be set to receive the monitoring messages. This function has to follow the signature of AK::Monitor::LocalOutputFunc and will be the function receiving the error message after the translation. It is in this function that you should define what you want to do with an error message. For example, in IntegrationDemo, LocalErrorCallback is the callback function. In the demo, when an error message is received, the current page content is modified to show the error message in red. To set the callback function, call AK::Monitor::SetLocalOutput() and pass the callback function pointer to be used.

Error Message Translators

The Sound Engine has one default translator which transforms the error codes in readable messages. However, this translator simply prints the information it receives, such as IDs, directly in the error message, without trying to transform them into useful information, such as object names. It is highly recommended that you add other translators to the project in order to receive more detailed error messages. The translators are located in the folder SDK/tools/AkWwiseErrorHandler.

참고: Some translators may require that other libraries are added to the project. Refer to the documentation of each translator for details.

Once the translators you want to use are added to the project, create an instance of them and install them in the monitor by calling AK::Monitor::AddTranslator(). It's important to keep track of the newly created instance in order to be able to delete it.

Translator Types

There are four translator types:

  • Default: Translates error codes into messages, but prints numerical identifiers for Game Objects, Events, Audio Nodes, etc.
  • XML: Translates error codes into messages and uses the information found in SoundBanks.xml to resolve identifiers for Event, Audio Node and Media into meaningful names. Game Objects and some other entities are left in numeric format.
  • WAAPI (AkAutobahn.lib must be added in the linker->input project option): Translates error codes into messages and connects to the Wwise project (through a live Wwise instance) to resolve all identifiers into meaningful names.
  • Unity: Same as WAAPI, but also uses information from Unity. Usable only in Unity projects.

Only the Default translator can handle standard printf-style tags (i.e., those that start with %). Each translator type can redefine how Wwise tags ($) should be handled. It's not necessary to handle every tag in a given translator. fallback translator can be defined, which is called after a translation attempt fails. A translator stack can then be created in order to chain multiple translators together until the translation is successful. The translator at the end of the stack is always a Default translator.

Supported Tags

Translators use a tag system similar to the printf() function. The following tags are supported:

  • Standard tags:
    • %i: Integer
    • %f: Float
    • %u: Unsigned Integer (32 bits)
    • %llu: Unsigned Integer (64 bits)
    • %s: Strings
  • Wwise tags:
    • $b: Bank Id
    • $g: GameObject Id
    • $m: Media Id
    • $p: Plugin Id and ShareSet Id
    • $s: Switch/State Id
    • $w: WwiseObject Ids, such as an Event Id
    • $$: Escape character

Creating a New Error Message Translator

If needed, it's possible to create a new error message translator. Simply create a new class that inherits from the AssistedErrorMessageTranslator interface.

This class has two abstract methods:

  • InitConnection(): Makes sure the connection to the external source was successful (i.e., ensures the translator is ready to be used)
  • GetInfoFromExternalSource(): Determines what to do with a given tag

Your new translator doesn't need to handle all tags. It can rely on the next translator in the stack.

참고: If the new translator implements a way to handle the $p tag, make sure it handles both arguments: Plugin Id and ShareSet Id. See the ParseWwiseTag example in AkDefaultErrorMessageTranslator.cpp.

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요