Character Beepy Voice with irregular pauses [SOLVED]

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
User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Character Beepy Voice with irregular pauses [SOLVED]

#1 Post by TellerFarsight » Sun May 20, 2018 10:48 pm

So I'm doing this thing to make the characters have beepy voices. There's some more stuff in the callback, which is why there's no elif and such.

Code: Select all

def talking_stick(char, event_name, interact=True, **kwargs):
        if not interact:
            return
        if event_name == "show_done":
            renpy.sound.play("audio/"+char.name+"bip.wav", loop="True")
        if event_name == "slow_done":
            renpy.sound.stop()
My issue is two things. One, the line will sometimes end in the middle of the beep sound and it will cut out somewhat painfully. Is there a way to make it stop at the end of a beep?
Two, the looping of the beep is too regular, and I want to make it sound more Morse-code-like, with beep dots and beep dashes. Is there a way to put in variable pauses after the sound before it loops, or have beeps overlap?
Last edited by TellerFarsight on Mon May 21, 2018 10:29 am, edited 2 times in total.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Character Beepy Voice with irregular pauses

#2 Post by TellerFarsight » Mon May 21, 2018 8:31 am

Like if I can have it randomly choose between two different beep sounds, that would work perfectly. Is this something I can do?

Code: Select all

if event_name == "show_done":
    random:
        renpy.sound.play("audio/"+char.name+"dot.wav", loop="True")
        or
        renpy.sound.play("audio/"+char.name+"dash.wav", loop="True")
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Character Beepy Voice with irregular pauses

#3 Post by TellerFarsight » Mon May 21, 2018 10:29 am

Figured it out, if anyone wants to use this. It creates a playlist beforehand that is randomly populated with dots and dashes, and then plays that. The playlist is re-randomized before each use.

Code: Select all

    def beeps(char):
        char.beeps = []
        for x in range(10):
            char.beeps.append(renpy.random.choice(["audio/"+char.name+"dot.wav","audio/"+char.name+"dash.wav"]))
    
    def talking_stick(char, event_name, interact=True, **kwargs):
        if not interact:
            return
        if event_name == "show_done":
            beeps(char)
            renpy.sound.play(char.beeps, loop="True")
        if event_name == "slow_done":
            renpy.sound.stop()
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

Post Reply

Who is online

Users browsing this forum: Bing [Bot]