Reputation: 11
I'm making an Ace Attorney fangame with RenPy. I want to play a "typing" sound when a character is talking.
I tried using this code:
define sounds = ['audio/sounds/bip1.mp3','audio/sounds/bip2.mp3','audio/sounds/bip3.mp3']
init python:
def type_sound(event, interact=True, **kwargs):
if not interact:
return
if event == "show":
for i in range (50):
renpy.sound.queue(renpy.random.choice(sounds))
elif event == "slow_done" or event == "end":
renpy.sound.stop()
I already have the sounds mentioned in the sounds
list.
The problem is that the sounds get played continuously even if there is a pause in the dialogue. For example, in another script, a character says "My name is Walter, Walter Romanng", and I made a pause between the comma and the rest of the sentence; the sound still plays during the pause.
How can I make the typing sounds match the pace and timing of the text on screen?
Upvotes: 1
Views: 1085
Reputation: 11
Okay I found what was the problem, when I wanted tu make a "pause", I was using the {cps =1}
tag but I find the right way to pause the dialogue:
"My name is Walter,{w=1} Walter Romanng"
this tag wait 1 second and then continue the dialogue, and it's not ignored by the type_sounds
function.
Upvotes: 0