Wwise SDK 2025.1.0
|
Android 오디오 레이턴시는 모든 애플리케이션에 항상 까다로운 문제입니다. 일반적인 레이턴시는 100 ms 이하이지만, 어떤 장치는 150 ms 까지 레이턴시를 내기도 합니다.
Over the years, Google introduced the several "paths" through which audio can flow from an app to the device's audio hardware:
When supported, these paths bypass various levels of internal processing to reduce the latency between the app and the hardware. 전반적인 레이턴시는 몇 십 밀리세컨드로 줄어들 수 있습니다. It is important to note that it is not mandatory for the hardware manufacturers to implement these paths; many do not. Furthermore, some devices can report a fast path without it actually being implemented. Therefore, a game cannot rely on the existence of fast audio paths on the end-user's devices. 보다 넓은 시장을 목표로 하는 게임이라면, 이 기능을 배제하고 게임 오디오를 설계해야 합니다.
일반적으로 낮은 레이턴시는 높은 CPU 비용을 필요로 합니다. RTPC 업데이트의 프로세스와 게임 오브젝트 위치 지정, 기타 게임 입력은 프레임 단위로 처리됩니다. 즉, 작은 프레임일수록 자주 처리됩니다. 레이턴시와 CPU 사용간 적절한 균형은 직접 실험을 해봐야만 정확히 알 수 있습니다. 일정하게 정해진 규칙이 없는 셈입니다.
다음과 같은 몇 개의 설정으로 Wwise SDK에서 오디오 레이턴시를 제어할 수 있습니다.
AkPlatformInitSettings::uSampleRate
: 사용할 샘플 레이트 When set to 0 (the default), the hardware preferred rate is selected, allowing use of the fast audio path.AkPlatformInitSettings::uNumRefillsInVoice
: 사전 처리를 위한 버퍼의 개수 이를 통해 CPU 가용성 문제나 중단으로부터 보호할 수 있습니다.AkInitSettings::uNumSamplesPerFrame
: 버퍼당 샘플 개수AkPlatformInitSettings::eAudioPath
: Which audio path to prefer based on device capabilities.AK::SoundEngine::GetDefaultSettings()
와 AK::SoundEngine::GetDefaultPlatformInitSettings()
로부터 반환되는 기본 설정은 일반적인 환경에서 대부분의 기기에 대해 비교적 안전한 설정이라고 할 수 있습니다. 이를 이용하면,
uSampleRate
를 하드웨어 선호 레이트로 설정합니다. 주로 48 kHz나 44.1 kHz로 설정됩니다.uNumSamplesPerFrame
to 512.uNumRefillsInVoice
를 4
로 설정합니다.AkPlatformInitSettings::eAudioPath
to AkAudioPath_LowLatency
.Advantages: This setup will select an appropriately low-latency audio path on devices that support it. 또한, 오디오 디자인의 CPU 사용 제한을 크게 줄입니다.
단점: CPU 변동에 따른 일부 공간을 허용하도록 네 개의 오디오 프레임이 사전 처리되어, 여유 공간이 필요 없는 장치에서 높은 레이턴시를 발생시킬 수 있습니다.
To initialize Wwise with the lowest latency, call AK::SoundEngine::GetDefaultSettings()
and AK::SoundEngine::GetDefaultPlatformSettings()
, then apply the following changes:
AkPlatformInitSettings::uNumRefillsInVoice
to 2.AkPlatformInitSettings::eAudioAPI
to AkAudioAPI_AAudio
.AkPlatformInitSettings::eAudioPath
to AkAudioPath_Exclusive
.장점: 최저 레이턴시 사용 가능.
단점: 가용 CPU가 제한됩니다. 오디오 렌더링에 할당된 시간이 매우 짧으며 시스템의 다른 이벤트에 의해 쉽게 방해받을 수 있습니다. 오디오 디자인의 CPU 오버헤드(RTPC, Switch, 위치 지정, 컨테이너)를 중점적으로 예의주시해야 합니다. Also, device compatibility is reduced. Only devices running Android 8.1 and above will have audio.
오디오 프레임을 처리하는 데 필요한 시간이 CPU가 처리할 수 있는 것보다 적을 경우, 오디오 고갈이 발생합니다. 이 때, 게임이 무음을 출력하고 있지 않으면 틱틱거리거나 끊기는 소리가 들릴 수 있습니다.
만약 이러한 작은 끊김도 허용해서는 안 될 경우, uNumRefillsInVoice
에서 고갈이 절대 발생하지 않도록 초기값을 충분히 큰 값으로 설정해놓으면 이러한 동작이 발생하지 않게 할 수 있습니다. uNumRefillsInVoice
는 최소 3으로 설정해야 하며, 대부분의 게임에서는 CPU 사용 변동에 대비해 여분을 더해 4로 돼있습니다.
Many Bluetooth devices cannot be low latency or use a fast audio path. In fact, to have glitchless audio with a Bluetooth device, the buffering must be a lot higher. Wwise will detect the usage of a high-latency Bluetooth headset and automatically override AkPlatformInitSettings::uNumRefillsInVoice
to reach a latency of 170 ms.
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요