Lip Sync Renpy

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
Andredron
Miko-Class Veteran
Posts: 776
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Lip Sync Renpy

#1 Post by Andredron »



Lipsync - the performer's lips move in sync with the original voice.

Renpy has many ways to make a character move his lips and blink in time with the audio channel.

The easiest way to create a random animation of the lips, as shown in the video, is to use the typewriter effect, in which while the text is going on, the character moves his lips and blinks his eyes non-stop.

Code - viewtopic.php?f=51&t=30279#p355693

or

viewtopic.php?f=8&t=4010&start=15

viewtopic.php?f=8&t=65858

The most accurate, which provides almost 100% hit, is to use alt animations

Video example https://vk.com/video653744750_456239072

For 100% hit, I recommend using this program

https://github.com/DanielSWolf/rhubarb-lip-sync

And transfer the received data to the renpi script, here is a rough example

https://pastebin.com/aE4jKjb2

Code: Select all

label start:
    
    scene living_room ### main background
    show maria01 ### animation sprite
 
    pause 1.5
 
    show maria_mouth_01 ### mouth animation 01
 
    voice "voice/001.ogg"
    nez "Good morning.{w=0.7}{nw}" ### at the end, write the total length of the audio file and switch to blinking eyes mode
 
    show maria_blink01 ### girl blinking eyes
 
    $ store._history = False ### specify not to write the following line to the history
 
    nez "Good morning.{fast}" ### instantly call the line of text that the character spoke. Аudio file is not registered
 
    $ store._history = True ### allow writing the following line of the dialog to history
 
 
 
    show maria02 ### animation sprite
 
    pause 3.2
 
    show maria_mouth_02 ### mouth animation 02
 
    voice "voice/002.ogg"
    nez "Woke up?{w=0.5}{nw}" 
 
    $ store._history = False
 
    show maria_blink01
 
    nez "Woke up??{fast}"
 
#mouth.rpy
init:
    image maria_mouth_01:
        pause 0.3
        "p01_8"
        pause 0.1
        "p01_2"
        pause 0.1
        "p01_3"
        pause 0.1
        "p01_8"
        pause 0.1
        "p01_4"
        pause 0.1
        "p01_5" 
        pause 0.2
        "p01_8"
        pause 0.1
 
    image maria_mouth_02:
        pause 0.3
        "p02_8"
        pause 0.1
        "p02_1"
        pause 0.1
        "p02_2"
        pause 0.1
        "p02_8"
        pause 0.2
        "p02_3"
        pause 0.1
        "p02_4"
        pause 0.1
        "p02_5"
        pause 0.1
        "p02_6"
        pause 0.1
        "p02_4"
        pause 0.3
        "p02_8"
        pause 0.1
 
### eyes
init:
####глаза
    image maria_blink01: 
        "p01_8"
        pause 3.2
        "p01_6"
        pause 0.1
        "p01_7"
        pause 0.1
        repeat
Of course, you can write a script that translates the program entries into the Renpy format, but laziness

or
viewtopic.php?f=8&t=65858
viewtopic.php?f=8&t=65665

Video taken from here - https://vk.com/seven_dots
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Sawa - a game of the Drow Nation

Honest Critique

Poses in visual novels, or how to hold a character properly in the frame

Help save articles to the webarchive. [/color]

Please save your projects on github, you would know how hard it is to find projects after 7 years...

User avatar
Andredron
Miko-Class Veteran
Posts: 776
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Lip Sync Renpy

#2 Post by Andredron »

https://github.com/Wendy-Nam/RenPy-Lipsync-Plugin

https://seo-a-nam.itch.io/lipsync-plugin-for-renpy

Video tutorial - https://drive.google.com/drive/mobile/f ... drive_link


Lip Sync Plugin for Ren'Py
Enhance your Ren'Py visual novel experience with the Lip Sync Plugin, integrating lip-sync animations seamlessly using the Rhubarb Lip Sync tool.
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Sawa - a game of the Drow Nation

Honest Critique

Poses in visual novels, or how to hold a character properly in the frame

Help save articles to the webarchive. [/color]

Please save your projects on github, you would know how hard it is to find projects after 7 years...

Post Reply

Who is online

Users browsing this forum: No registered users