Wwise 버전
Wwise SDK 2021.1.6
Custom Scheduling of Audio Rendering

오디오 렌더링 스레드

기본적으로 Wwise 사운드 엔진은 모든 명령 처리와 오디오 렌더링을 전용 스레드인 AK::EventManager 에서 처리하며, 이는 AkPlatformInitSettings::threadLEngine 매개 변수로 제어됩니다. Calling AK::SoundEngine::RenderAudio signals the end of a game frame and allows the thread to consume all API commands received since the previous call to RenderAudio.

Setting AkInitSettings::bUseLEngineThread to false disables this thread and causes RenderAudio to run synchronously: processing commands and, if needed, rendering audio. 실제 오디오 출력 레이트는 그대로 오디오 말단에 의해 제어됩니다. If the RenderAudio call interval is shorter than the buffer period determined by AkInitSettings::uNumSamplesPerFrame and the output sample rate, some calls to RenderAudio will skip the audio rendering portion. Conversely, if the RenderAudio call interval is longer than the output buffer period, RenderAudio may process more than one buffer at a time, causing a CPU usage spike, and may eventually cause the audio to stutter.

Enabling offline rendering disables asynchronous command processing and audio rendering from the audio thread. The amount of audio rendered per call to RenderAudio is determined by a positive non-zero value sent to AK::SoundEngine::SetOfflineRenderingFrameTime. A zero or negative value will force RenderAudio to process precisely one audio buffer.

경고: With the audio rendering thread disabled or with offline rendering enabled, synchronous AK::SoundEngine::LoadBank and AK::SoundEngine::UnloadBank API calls must not be made from the same thread as the caller of RenderAudio. This is because these calls may block until an audio buffer is rendered to complete Stop operations and free SoundBank media, which won't happen without a concurrent call to RenderAudio.

On Microsoft platforms, due to the use of a single-threaded apartment (STA) concurrency model, CoInitializeEx() must be called from the same thread that calls AK::SoundEngine::RenderAudio when setting AkInitSettings::bUseLEngineThread to false.

오디오 렌더링 작업의 병렬 처리

기본적으로 Wwise 사운드 엔진은 Bus와 Voice를 오디오 렌더링 스레드에서 처리합니다.

Parallel execution of individual Bus and Voice tasks can be enabled via AkInitSettings::taskSchedulerDesc. Wwise will call the AkTaskSchedulerDesc::fcnParallelFor callback for any group of tasks that can be safely executed concurrently. 이 요청은 게임 단의 작업 스케줄러로 전달되어, 작업자 스레드들에 걸쳐 처리 범위를 분산합니다.

참고: When enabling parallel execution, some AK::SoundEngine callbacks will be generated from concurrent task scheduler threads.
참고: 일부 플러그인은 병렬 처리를 지원하지 않을 수 있습니다.