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.
I was wondering is there a way to make sound effect on single channel to overlap each other.
For example I have a card draw effect that is set to 0.1 loop delay and duration of .mp3 is 1 second so if I run this code it will work but I will get this choppy-breaking sound, same as you would get by spamming the replay button on your media player if you know what I mean.
So what I want is even if my code loop is set to 0.1 seconds the duration of sound effect should be played until the end no matter if I want to play same sound effect over and over.
init python:
def SFX_Play(sfx=None,volume=1.0,musicChannel=None):
# Set volume of SFX
renpy.music.set_volume(volume, channel=musicChannel)
# Take one of possible sound effects
if sfx != None:
soundToPlay = random.choice(sfx)
# Play the generated sound
renpy.play(soundToPlay,channel=musicChannel)
SFX_Play(["sfx1.mp3", "sfx2.mp3"], 1, "sounds")
Anyone can help with this please?
Last edited by Nero on Wed Aug 03, 2022 8:46 am, edited 1 time in total.
Documentation wrote:In addition to the normal channel, there is one special channel, audio. The audio channel supports playing back multiple audio files at one time, but does not support queueing sound or stopping playback.