Playing Sound with Delay and Looping

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
lsf22
Regular
Posts: 98
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Playing Sound with Delay and Looping

#1 Post by lsf22 » Thu Mar 17, 2022 3:17 pm

Renpy Version 7.4.11

If I wanted to not only have my sound play with looping but also with a delay, do I need to define that sound or can it be done with auto sound settings?

Example:

Code: Select all

	scene room_1
	play sound "audio/sound/alarm_clock_1" loop
	pause # Usually when I do a scene it gets skipped over if there is no dialogue or pause

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Playing Sound with Delay and Looping

#2 Post by Ocelot » Thu Mar 17, 2022 4:00 pm

You need to explain more. What exactly should happen? What delay, where and when should it happen?
< < insert Rick Cook quote here > >

lsf22
Regular
Posts: 98
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Playing Sound with Delay and Looping

#3 Post by lsf22 » Thu Mar 17, 2022 4:17 pm

For my sound that I want played, I want a delay of 3 seconds for it before it loops again

Code: Select all

play sound "audio/sound/Alarm_Clock_1.ogg" loop delay=?? #I've tried some codes but I'm not sure which one is actually right for the delay

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Playing Sound with Delay and Looping

#4 Post by Ocelot » Thu Mar 17, 2022 5:27 pm

Code: Select all

play sound ["audio/sound/Alarm_Clock_1.ogg", "<silence 3.0>"] loop
< < insert Rick Cook quote here > >

lsf22
Regular
Posts: 98
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Playing Sound with Delay and Looping

#5 Post by lsf22 » Mon Mar 21, 2022 3:07 pm

That worked fine for sound. But for voice what is the equivalent of that? I tried using that same code for voice and it didn't' work out

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Playing Sound with Delay and Looping

#6 Post by Ocelot » Mon Mar 21, 2022 7:26 pm

Do you mean automatic voicing for dialogue? You will either need to separate dialogue in two parts or edit silence in the beginning of your file.
< < insert Rick Cook quote here > >

lsf22
Regular
Posts: 98
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Playing Sound with Delay and Looping

#7 Post by lsf22 » Mon Mar 21, 2022 7:47 pm

I'm unsure if it's best applied as a sound instead and placed on another channel so that it doesn't interfere with other sounds going on. It's a characters voice that I intended to be used repeatedly from one looped video to another another video but without it overriding any sound effects. Just to clarify it's not dialogue, it's just that character moaning.

Maybe this can give an idea on what I want

Code: Select all

Label H_scene_#1:

    scene H_animation_1
    play sound ["audio/sound_effect/v1.ogg", "<silence 0.5>"] loop
    voice "audio/voice/char_Jane_moan_1.ogg" #looping at every 0.5 seconds  wanted
    pause

    scene H_animation_2
    # Next scene with desired looping voice and sound from previous scene carried over
    pause

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Playing Sound with Delay and Looping

#8 Post by Ocelot » Tue Mar 22, 2022 2:44 am

You are trying to shove square peg into round hole. voice statement is created for a very specific use of "this sound file voices this dialogue". Do not try to repurpose it.

In your case it is better to play it on its own channel (ot music channel if you do not have music here), if there would be other sounds playing.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: No registered users