menu
 

Animation Lip Sync with Wwise Meter Plug-in

오디오 프로그래밍 / 게임 오디오

Introduction

This is the last of a 3-part tech-blog series by Jater (Ruohao) Xu, sharing the work done for Reverse Collapse: Code Name Bakery.

  • You can read the first article here, where he dives into using Wwise to drive in-game cinematics.
  • You can read the second article here, where he explores how the game's tilted 2D top-down view required a custom 3D audio system to solve unique attenuation challenges.

Animation Lip Sync with Wwise Meter Plug-in

Tech Blog Series | Part 3

There are plenty of elements and moments in the game where the gameplay mechanics are driven by the audio. With the help the Wwise Meter plug-in, we are able to acquire real-time accurate audio data that can be sent back to the game engine to power multiple audio systems.

Like many other anime-themed games, Reverse Collapse features rich story dialogues; while some of them are triggered in the combat gameplay, most of them are 2D narratives in which you have 2 characters doing call-and-response sequences on the left and right sides of the screen.

img1

The picture above showcases an example of a 2D narrative system within the game, where the character Mendo is talking while the screenshot was taken. When the speech triggers, a lip animation is played on the character's sprites. This functionality is driven by audio volume data obtained from Wwise.

The game can synchronize lip animations with speech by utilizing audio volume data, enhancing the immersion and realism of character interactions. This approach adds depth to the narrative experience, making it more engaging for players.

To acquire the volume data in real time, Wwise Meter plug-in (Wwise Meter (audiokinetic.com)) is used, this is an easy-to-use and very effective plug-in that can send the audio data from Wwise to the game engine. The picture below shows the meter setup on our main speech bus.

img2

img3

Inside the Wwise Meter plug-in, we linked the RTPC named Speech_MeteringData, which is responsible for sending data back to the game engine. This RTPC captures the output volume information from speech triggered in the game. We clamp the value from -48 to 0, representing the range of audio volume levels. While it's possible for the value to exceed 0 if the speech volume is peaking, it's generally recommended to avoid this scenario in typical mix settings, ensuring that the value stays below 0.

By setting up this configuration, we can accurately capture and transmit audio volume data to the game engine in a controlled manner, facilitating the implementation of various gameplay mechanics.

The paragraphs above conclude the setup on the Wwise side. To use the data on the game engine side, we just need to add a few lines of code to detect the range of the volume and transfer that number into usable data for our animation system. The animation code here is roughly written as each game will have different animation systems or plugins.

For our game, we do not have a complicated animation system, the character's mouth only has Open and Closed states, thus we can simply use a ternary conditional operation to get if we should open the mouth of the speaking character and animate accordingly. (Refer to the paragraphs above for the implementation of GetGlobalRTPC())

bool bIsCharacterMouthOpen = (GetGlobalRTPC(“Speech_MeteringData”) > -48.0f  && GetGlobalRTPC(“Speech_MeteringData”) <= 0) ? true : false;

For many other games, especially 3D ones, characters may have joints and bones in the character skeleton rig, we can adjust the angle of the joint that is used by the animator to alter the mouth openness. This is usually represented by a float number. Here, for example, assume this number can be acquired by speakingCharacter.SetMouthOpenness(float mouthJointAngle), the min and max angle of mouth opening is 0 degrees to speakingCharacter.MaxMouthOpenness() degrees.

In this example, we'll create a small wrapper function to extract the output value of the parameter modifier and apply it on demand in the area where we intend to use this functionality.

public float GetGlobalRTPC(string rtpcName)
{
    int rtpcType = 1;
    float acquiredRtpcValue = float.MaxValue;
    AkSoundEngine.GetRTPCValue(rtpcName, null, 0, out acquiredRtpcValue, ref rtpcType);

    if(acquiredRtpcValue >= 0.25 && acquiredRtpcValue <= 16)
    {
        return acquiredRtpcValue;
    }
    else
    {
        return 1.0f;
    }
}

In addition to setting the RTPC globally, the function above will also ensure that if incorrect values are detected, it will ignore the RTPC to be set, and reset the value to 1.0f, which is the default.

In this case, we can improve the code above to support this by using the following function:

public float SetMouthOpenessByWwiseAudio()
{
    float mouthOpennessToSet = 0.0f;
    float retrievedMeteringRTPCvalue = GetGlobalRTPC(“Speech_MeteringData”);

    if (retrievedMeteringRTPCvalue > -48.0f && retrievedMeteringRTPCvalue <= 0)
    {
        mouthOpennessToSet = speakingCharacter.MaxMouthOpenness() * Normalization(retrievedMeteringRTPCvalue, -48.0f, 0.0f));
    }

    speakingCharacter.SetMouthOpenness(mouthOpennessToSet);
}

Indeed, the function provided will accurately set the mouth openness based on the audio volume data received from the Wwise Meter plug-in. This ensures that the mouth animation is precise and smoothly synchronized with the audio volume.

Disclaimer: The code snippets utilized in this article are reconstructed generic versions intended solely for illustrative purposes. The underlying logic has been verified to function correctly, specific project-specific API calls and functions have been omitted from the examples due to potential copyright restrictions.

Ruohao (Jater) Xu

Audio Programmer, Technical Sound Designer

Ruohao (Jater) Xu

Audio Programmer, Technical Sound Designer

Jater Xu is a seasoned audio programmer and technical sound designer specializing in interactive audio solutions with Wwise integration in both Unreal and Unity using C++, blueprint, and C#. His work drives the immersive soundscapes in acclaimed games such as Homeworld 3, The Chant, and Reverse Collapse.

댓글

댓글 달기

이메일 주소는 공개되지 않습니다.

다른 글

Wwise를 사용하여 UE 게임에 두 개의 오디오 장치 구현하기

먼저 제 소개를 해드릴게요. 저는 에드 카신스키(Ed Kashinsky)이며 러시아 상트페테르부르크 출신 사운드 디자이너 겸 음악가입니다. 현재 저는 아주 흥미롭고 독특한...

15.9.2020 - 작성자: 에드 카신스키(ED KASHINSKY)

동적 음악 설계에 관하여 - 제 1부: 설계 분류하기

설계 계기 저는 2015년에 오디오 게임 엔지니어로서 처음 일을 하게 되면서 그 당시 저의 아트 디렉터를 통해 Wwise를 접하게 되었습니다. 그전에 저는 게임 음악을 작곡하는...

7.10.2020 - 작성자: 천종 호우 (Chenzhong Hou)

Wwise 미디 기본 지식: 뉴 슈퍼 럭키스 테일(New Super Lucky Tale)의 폭스베리 타이머 음악적 미디 마법!

안녕하세요 멋진 Wwise 사용자분들 :) 게임 오디오 업계에서 살아남기 위한 필수적인 스킬은 바로 문제를 해결하는 능력입니다. 사용하는 도구의 크고 작은 모든 면을 아는 것은...

8.2.2021 - 작성자: 애론 브라운(AARON BROWN)

게임 사운드 보관 | 제 2부: '컨커 최악의 날'과 미스터리한 MP3

오늘 소개할 이야기는 뜻밖의 결과, 다시 말해 우연한 발견에 관한 이야기입니다. 연구 프로젝트가 의도한 대로 끝나지 않았기 때문에 복잡하게 느껴지실 수도 있지만 끝까지...

29.9.2021 - 작성자: 파니 러비야르 (Fanny REBILLARD)

Wwise를 사용한 반복 재생 기반 자동차 엔진음 디자인 | 제 1부

이 시리즈에서는 Wwise Authoring과 오디오 및 자동차 전문 지식을 알맞게 사용해서 간단한 반복 재생 기반 자동차 엔진 사운드를 디자인하는 방법을 살펴보려고 합니다! ...

18.4.2023 - 작성자: 아르토 코이비스토 (Arto Koivisto)

무료 Wwise 인디 라이선스 | 최상의 오디오로 인디 개발자에게 힘을 실어줍니다

프로젝트의 비전에 맞는 몰입형 오디오 경험을 만드는 것은 특히 예산이 제한된 인디 개발자에게는 어려울 수 있습니다. 바로 이를 위해 Audiokinetic의 Wwise는 인디...

18.7.2024 - 작성자: Audiokinetic (오디오키네틱)

다른 글

Wwise를 사용하여 UE 게임에 두 개의 오디오 장치 구현하기

먼저 제 소개를 해드릴게요. 저는 에드 카신스키(Ed Kashinsky)이며 러시아 상트페테르부르크 출신 사운드 디자이너 겸 음악가입니다. 현재 저는 아주 흥미롭고 독특한...

동적 음악 설계에 관하여 - 제 1부: 설계 분류하기

설계 계기 저는 2015년에 오디오 게임 엔지니어로서 처음 일을 하게 되면서 그 당시 저의 아트 디렉터를 통해 Wwise를 접하게 되었습니다. 그전에 저는 게임 음악을 작곡하는...

Wwise 미디 기본 지식: 뉴 슈퍼 럭키스 테일(New Super Lucky Tale)의 폭스베리 타이머 음악적 미디 마법!

안녕하세요 멋진 Wwise 사용자분들 :) 게임 오디오 업계에서 살아남기 위한 필수적인 스킬은 바로 문제를 해결하는 능력입니다. 사용하는 도구의 크고 작은 모든 면을 아는 것은...