버전
menu

Understanding how SoundBanks are loaded in a game

Wwise에서 SoundBank를 만들고, 채우고, 생성하는 법을 배우기 전에 먼저 게임에서 SoundBank 정보를 불러오고 관리할 수 있는 여러 가지 방법을 이해하는 것이 더 중요합니다. 최적의 방법은 개발 중인 게임의 유형, 게임을 실행할 플랫폼, 프로젝트 팀이 가진 제약 등 여러 가지 요인에 따라 다를 것입니다.

유연성을 최대한 확보하고 거의 모든 게임 유형의 요구 사항을 충족시키기 위해 Wwise는 다음과 같이 게임에서 오디오와 모션을 불러오는 다양한 방법을 제공합니다.

Loading full SoundBanks

SoundBank를 불러오는 전통적인 방법은 바로 Event 데이터, 오브젝트 구조 데이터, 미디어가 모두 담긴 SoundBank를 사용하는 것입니다. 이러한 SoundBank의 전체 콘텐츠는 게임의 특정 시점에 불러오거나 내려서 Event 데이터와 연관 미디어가 유발될 때 잘 재생될 수 있도록 준비해야 합니다.

다음 그림은 전통적인 방법으로 만든 SoundBank가 게임의 Level1에서 Level 2로 플레이어가 이동할 때 플랫폼 메모리에서 어떻게 올라가고 내려가는지 보여줍니다.

특정 SoundBank의 모든 데이터와 미디어가 동시에 메모리에 올라가기 때문에, 이 방법은 모든 데이터와 미디어가 필요할 때 재생할 준비가 되도록 보장해 줍니다. 뿐만 아니라 게임 플레이 도중 디스크의 탐색(seek)을 최소화해서 디스크를 많이 사용하는 다른 작업을 실행하도록 공간을 확보해 줍니다.

이 방법의 주된 단점은 바로 SoundBank를 불러오는 시간 동안 메모리가 상당히 많이 소비되기 때문에 대규모의 정교한 게임을 처리할 때에는 유연성이 떨어진다는 것입니다. 또한 이 방법은 미디어 파일이 이미 메모리에 올라가 있는지 확인하지 않은 채 SoundBank의 모든 콘텐츠를 명시적으로 불러옵니다. 그렇기 때문에 동일한 미디어 파일이 메모리에 두 번 이상 로드될 수가 있습니다. 이러한 단점이 있음에도 불구하고 전통적인 방법은 여전히 다양한 상황에서 유용합니다. 예를 들어 전형적인 핀볼 게임에서는 모든 데이터와 미디어를 항상 사용할 수 있어야 합니다.

Preparing SoundBanks (all content)

LoadBank() 메커니즘의 몇 가지 단점을 극복하려면 AkBankContent_All()을 사용해서 SoundBank를 불러오는 대신 뱅크를 준비해 놓으면 됩니다. 이 방법을 사용할 경우 SoundBank에 여전히 모든 콘텐츠 유형(Event, 구조 데이터, 미디어 파일)이 들어 있을 수 있지만, 이 방법은 미디어 파일을 명시적으로 불러오는 대신 PrepareEvent() 방법을 통해 모든 미디어를 메모리에 불러옵니다. 이 방법을 사용하여 미디어를 불러오면, Wwise는 미디어 파일을 불러오기 전에 먼저 이 미디어 파일이 이미 메모리에 있는지를 확인합니다. 이 방법은 메모리에 미디어 파일이 복제되는 것을 막아주기 때문에 메모리 사용량을 최소한으로 유지해줍니다.

또한, 이 방법은 메모리 절약 뿐만 아니라 디스크 접근이 순차적으로 이루어지도록 보장합니다. 이 방법을 사용하면 PrepareEvent()를 통해서 Event가 하나씩 준비될 때 일어날 수 있는 랜덤한 디스크 탐색을 방지할 수 있습니다.

다음 그림은 '뱅크 준비하기(모든 콘텐츠)' 메커니즘이 어떻게 메타데이터와 콘텐츠를 플랫폼 메모리에 불러오는지를 보여줍니다.

Vorbis로 인코딩되거나 WEM Opus로 인코딩된 미디어가 있는 SoundBank를 불러올 경우 Preparation_LoadAndDecode 준비 유형을 통해 이러한 미디어 파일을 압축되지 않은 PCM으로 디코딩할 수 있습니다. 이 경우 결과적으로 SoundBank는 더 커지지만 Event가 미디어를 호출할 때 디코딩할 필요 없이 즉시 미디어를 재생할 수 있습니다.

Action Event 준비하기

The PrepareEvent() method dynamically loads media when it is required. To use method, the Action Event metadata must be in a loaded SoundBank and the associated media files must be accessible in the file system. The corresponding structure metadata can be included in the same SoundBank as Events or placed in a separate SoundBank, either user-defined or auto-defined. It can therefore simplify Event and SoundBank management because you can prepare multiple Events without the need to remember which SoundBanks contain the necessary media: the Wwise sound engine automatically retrieves the required files, wherever they are.

This method ensures that after a PostEvent call, the Action Event audio is played immediately (on the same frame) because there is no need to load the media. However, it uses more memory than other methods because the media and metadata are loaded and remain in memory.

[참고]참고
  • Action Event만 미리 준비할 수 있습니다. 'PrepareEvent()' 방법은 Dialogue Event에 사용할 수 없습니다.

  • Avoid using PrepareEvent() when working with the Wwise Unreal Integration. Unreal embeds media files in their respective events or Asset Libraries, so PrepareEvent() would not be able to function correctly.

  • Streamed audio that does not have a prefetch buffer cannot be prepared because the audio is played directly from storage.

To use this method, call the LoadBank() method to load the SoundBank that contains the Action Event metadata and keeps it in memory. When PrepareEvent() is called, the sound engine then "prepares" the Action Events before the game calls PostEvent(). To prepare an Event, the sound engine loads all non-streaming, referenced media files from the file system and all referenced structure metadata from a SoundBank, if it is not already loaded. When the Action Event is no longer required, unload it with Preparation_Unload so the corresponding media files are purged from memory.

다음 그림은 Event가 미리 준비되어 필요한 미디어 파일만 메모리로 올리는 법을 보여줍니다.

When the metadata (also referred to as structure data) is not stored in the same SoundBank as the Events, Wwise includes references to the corresponding content stored in other SoundBanks. 이름이나 ID를 사용해서 다른 SoundBank를 참조할 수 있는 것이죠. To use the SoundBank name in the sound engine, you must select the Use SoundBank Names option on the SoundBanks tab of the Project Settings dialog. To use IDs, clear the option. For more information, see “SoundBanks Tab”.

Media that a SoundBank references must be stored as loose files on disk or be resolvable by the low-level IO (such as in a File Package).

This method uses memory efficiently but performs more disk seeking than other methods, which might not be appropriate in situations when many files are already being streamed from the disk. Also, if the game uses States and Switches, media files could be loaded into memory unnecessarily. For example, if there are different sounds for the different moods or energy levels of a crowd in your game, they are all loaded into memory even if only some of the Switch sounds are valid within a particular zone of the game. To avoid this problem, you can prepare specific States or Switches that only load the media files associated with the prepared States or Switches.

The following illustration shows how you can prepare Switches in advance to limit the amount of media that is loaded into memory at any particular point in the game.

Game Sync를 미리 준비하면 메모리 사용량을 최적화할 수 있지만, 이 경우 미디어를 메모리에 불러오는 속도도 감소된다는 점을 주의하세요. Read times are longer when the sound engine needs to search the disk to find the sounds that correspond to the prepared game syncs.

By dynamically loading only the required audio files, The second method provides flexibility to handle situations where you have either large zones or levels with many sounds, or limited amounts of memory available to store Event data, structure data, and media.

[참고]참고

LoadBank, AkBankContent_All, PrepareEvent, PrepareGameSyncs, AkBankContent_StructureOnly 기능은 Wwise API에서 접근할 수 있습니다. For more information on loading SoundBanks and preparing Events and game syncs, see the Integrating Banks section of the Wwise SDK.

For a detailed overview of the different methods you can use to manage your SoundBanks, see “Strategies for managing SoundBanks”.


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

지원이 필요하신가요?

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

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

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

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

Wwise를 시작해 보세요