Sound effect when character is talking?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
voidface
Newbie
Posts: 1
Joined: Sun Mar 20, 2022 3:51 pm
Contact:

Sound effect when character is talking?

#1 Post by voidface »

I'm trying to create a typerwriter-like effect for when a character is talking. I've searched far and low on reddit, this forum, youtube, etc. and I still can't seem to get it to work. I get no error code, I've tried to tweak the code in various ways and still no result. So finally I've decided to just ask on here!

Code: Select all

init python:
    def low_beep(event, interact=True, **kwargs):
        if not interact:
            return
        if event == "show":
            renpy.sound.play("game/audio/Dialogue3_loop.mp3", channel="sound", loop=True)
        elif event == "slow_done" or event == "end":
            renpy.sound.stop(channel="beeps")

    def mid_beep(event, interact=True, **kwargs):
        if not interact:
            return
        if event == "show":
            renpy.sound.play("game/audio/Dialogue1_loop.mp3", channel="sound", loop=True)
        elif event == "slow_done" or event == "end":
            renpy.sound.stop(channel="sound")

    def high_beep(event, interact=True, **kwargs):
        if not interact:
            return
        if event == "show":
            renpy.sound.play("game/audio/Dialogue2_loop.mp3", channel="sound", loop=True)
        elif event == "slow_done" or event == "end":
            renpy.sound.stop(channel="sound")
I've also applied each effect to different characters

Code: Select all

init:
    $ mc = Character("[name]", callback=mid_beep)
    $ narrator = Character(None, callback=low_beep)
If anyone has a clue what's going on that'd be grand!

Post Reply

Who is online

Users browsing this forum: Amazon [Bot]